Closed NoMoreViolence closed 3 years ago
If you want to have the initial value synchronously extracted from the BehaviorSubject
then you should consider using useObservableEagerState
https://observable-hooks.js.org/api/#useobservableeagerstate .
Alternatively, you could provide the useObservableState
an "initial value" as its second argument. Like:
const tempBehavior = useObservableState(tempBehavior$, {});
This is actually a bug. useObservableState
should pick up the BehaviorSubject.value
automatically. I am fixing the tests to reflect that.
The title says it all
Test Link is here: https://codesandbox.io/s/aged-butterfly-rqzwb?file=/src/App.tsx
the typing about this form should be like that
rxjs version: 6, 7 (both not working)