Persist the same store multiple times depending on user account #525
Replies: 1 comment 1 reply
-
Hi, is this related to #513? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the zustand persist middleware, but I don't want the state to be shared across user accounts. Is it possible to namespace it? Or in other words, can I use the middleware to persist the same store multiple times?
I've tried to use the user id as part of the name, but I would need some way to recreate the storage whenever a user logs in. Right now it just reuses the same storage as before.
Also, I access the store both inside and outside of React components, so I would need to keep that functionality.
Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions