State type.
An Observable of state values.
The current state value, or undefined if no value has been emitted yet.
A hook that subscribes to an Observable and returns its current value.
Unlike the standard useObservableState from observable-hooks, this hook
will synchronously get the initial value if the Observable emits synchronously.
This prevents an extra render when the Observable has an immediate value.
If the Observable does not emit synchronously, the hook returns undefined
for the initial render (unlike useObservableEagerState which throws).
The synchronous render probe is closed immediately. The retained subscription is created by the effect so React Strict Mode cannot orphan render-phase work.
State type.
An Observable of state values.
The current state value, or undefined if no value has been emitted yet.
A hook that subscribes to an Observable and returns its current value.
Unlike the standard
useObservableStatefrom observable-hooks, this hook will synchronously get the initial value if the Observable emits synchronously. This prevents an extra render when the Observable has an immediate value.If the Observable does not emit synchronously, the hook returns
undefinedfor the initial render (unlikeuseObservableEagerStatewhich throws).The synchronous render probe is closed immediately. The retained subscription is created by the effect so React Strict Mode cannot orphan render-phase work.