Skip to content
Discussion options

You must be logged in to vote

Yes, please refer to set<K extends StringKeyOf>

The second overload allows you to pass in a function to update the data based on the previous state.

state.set("mood", (mood) => mood - 1),

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fsharpn00b
Comment options

Answer selected by fsharpn00b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants