Subscription usage #5
-
Hey! I have a few questions about using the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey @devnaumov , thanks for your questions. I will improve the docs to make this clearer.
Yes, using Currently, computed values don't have the
If you are using It is best practice to always call If you are using a global store, there is no automatic unsubscription. I'm not sure if this is possible or desirable - please let me know if you have any ideas on why or how this could be implemented. For more details on how (I will update the docs now, it should be live shortly) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clear explanation! |
Beta Was this translation helpful? Give feedback.
Hey @devnaumov , thanks for your questions. I will improve the docs to make this clearer.
Yes, using
todoStore.activeTodo.onChange(someLogic)
is perfectly fine, assuming thatactiveTodo
is state.Currently, computed values don't have the
onChange
method, but I'll consider adding it in the future.If you are using
createStoreContext
, theProvider
component automatically unsubscribes from all store effects when the component is unmounted.I…