-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Despite this test passing, for the first render the state is always undefined.
To Reproduce
Steps to reproduce the behavior:
- import
useEpic - use it in a component with an Epic that returns an either a
BehaviorSubjectwith initial state or an observable that pipes tostartWith - Rely on (or just log) that state on the component render
Expected behavior
The state should be available on the first render
Additional context
One solution would be to subscribe and unsubscribe immediately in first render to get the initial state. If that solution is used we should give a way to opt out, because that could cause weirdness with other peoples observables.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working