Persist called unnecessarily #2413
Unanswered
Fabioni
asked this question in
Bug report
Replies: 1 comment 4 replies
-
Sounds like a reasonable improvement. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Persist
setItem
is called every time the globalset()
function is called evenSo there are many many unnecessarily updates to persistent storages. Since the documentation said it is better to use one big single store, that means many people probably have a very big store with lots of updates, but usually only save a smaller part of that big store to the persistent storage. This means there are lots of unnecessarily storage updates.
Zustand internally already knows if something has changed after calling the global
set()
, so Zustand should use that to determine if a call to the setItem is necessary or not.Beta Was this translation helpful? Give feedback.
All reactions