crimx/observable-hooks

A variant of `useObservableState` which uses `useLayoutSubscription` instead of `useSubscription`

OliverJAsh opened this issue · 4 comments

I am in the process of migrating some code to use observable-hooks, however I am unable to migrate with complete parity because I need a variant of useObservableState which uses useLayoutSubscription instead of useSubscription.

What do you think about exposing a hook like this?

crimx commented

You are right there should be a useLayoutObservableState. Would you like to make a PR?

Yes! i guess it will be identical to useObservableState except a different subscription time. Should I copy/paste or try to share logic?

crimx commented

It should be similar to useLayoutSubscription and useLayoutObservable.

crimx commented

Added