You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found this hook to be quite useful.
The interface would be something like this
const{ state, set, useValue, useOnChange }=useObservableState('initial_value');// state.current -> current value of the state// set -> sets the new value of the state and notifies all listeners// useValue -> registers a listener and returns a state that causes rerender // useOnChange -> registers a listener and accepts a callback that gets called on updates
If you're interested I could send a PR
The text was updated successfully, but these errors were encountered:
I've found this hook to be quite useful.
The interface would be something like this
If you're interested I could send a PR
The text was updated successfully, but these errors were encountered: