Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Example needed: path options and namespaces #428

Open
vicenterusso opened this issue Sep 15, 2021 · 1 comment
Open

Example needed: path options and namespaces #428

vicenterusso opened this issue Sep 15, 2021 · 1 comment

Comments

@vicenterusso
Copy link

vicenterusso commented Sep 15, 2021

How can I use the key and path options with multiple namespaces?

@Harm-Nullix
Copy link

Make more createPersistedState objects?
The key is purely for you localstorage index, so if you want more of that, you shouldmake more objects.

If you want more paths, in my app I have a namespace called tabs where in that state, there lives a couple of objects and of that objects, I only want to save one: list, so when I want to include that namespace, I use paths: ['tabs.list']. My guess to put more namespaces in one storage object is using things like:

paths: ['tabs.list', 'colors', 'myTacoNamespace`]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants