Closed SteJ13 closed 1 year ago
Hi,
I would recommend creating a function called getDefaultStoreState()
or something along those lines.
You can use this function to fill the store when you initialize it for the first time. And then you can also call Store.replace(getDefaultStoreState())
when you need it to be reset. Stores are individually managed and not connected in any way, so you'd have to do this for each store.
Store state management is entirely up to you, and there are multiple ways to deal with these kinds of issues.
In the future it might make sense for a Store.reset()
method.
Hope that helps you!
Discussed in https://github.com/lostpebble/pullstate/discussions/158