-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Sometimes I have a zustand state where I add top-level keys dynamically. For example, it might start off like:
useSomething = create(()=>({}))Then I might later do:
useSomething.setState({[some_id]: some_value})If undo/redo is merging past states into the current state, then the "some_id" won't be removed.
I'm guessing it is merging, based on this line:
Line 25 in 65a1c99
| userSet(nextState); |
It's not a big deal, as I can just add a permanent top-level key and put the dynamic keys inside of that. Adding an option to overwrite state could be nice though, unless there's a way to do that already.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested