hookstate
hookstate copied to clipboard
How to unsubscribe to a state once we subscribe to it ?
https://hookstate.js.org/docs/extensions-subscribable In the docs page, you mention how to subscribe to state, there is no mention of how to stop subscribing or how to unsubscribe there.
subscribe function returns a function, which should be called when you want to unsubscribe. Notice useEffect uses the unsubscribe callback returned by the subscribe function.
Thanks for the clarification ! It would be good if you also mention in the docs that we can monitor for state outside of component by using subscribable plugin directly with hookstate function.
this is assumed that global state has access to the same extensions as the locally created state... but ok, I will mention it..
Hey thanks for the quick support ! Hookstate 4 basically covers every use case we came across in our project and its api is absolutely wonderful. Thanks for making such a great library for the community ❤️ 🙏🏻 Cheers ❇️ ✨
Thanks. Please consider to help the project by spreading few words about it.