Skip to content

Feature request: useObservable to return the instant value on Component initialize if Observable has sync value #369

Description

@gyz0072004

In my component, I use an useEffect to do some initialization with side effect.

const title = useObservable(() => titles$);
useEffect(() => {
    // do initialization with title
}, []);

title$ is a BehaviorSubject, so I would like the useEffect block can get the current title value directly, so that I don't need to wait another cycle for the initialization.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions