Accessing previous state when updating state with Immer #2737
-
Referencing to discussion #821 i have struggles with implementing this feature with store using Immer. How can i do the same?
|
Beta Was this translation helpful? Give feedback.
Answered by
dbritto-dev
Sep 12, 2024
Replies: 2 comments
-
@haveprogrskillissues https://zustand.docs.pmnd.rs/apis/create-store#updating-state-based-on-previous-state |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
haveprogrskillissues
-
Rewrote the function as documentation follows:
|
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
@haveprogrskillissues https://zustand.docs.pmnd.rs/apis/create-store#updating-state-based-on-previous-state