Can I call a setter function within subscribe? #2950
Replies: 1 comment
-
Sorry, just figured it out. I can call useDogStore.setState() to achieve this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's an example from the guide:
Let's say instead of doing console.log, I'd like to set another value in the store. ex) I'd like to set "hasUnsavedChanges" to true (maybe the store has a "setUnsavedChanges" function in it now). Is there a way for me to do that? Basically, is there a way for me to access one of the setter functions within my store from inside a subscription?
Beta Was this translation helpful? Give feedback.
All reactions