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

Reset store to intial state #18

Closed
mkelley82 opened this issue Jul 28, 2017 · 3 comments
Closed

Reset store to intial state #18

mkelley82 opened this issue Jul 28, 2017 · 3 comments

Comments

@mkelley82
Copy link

How would you go about resetting the store to the initial state (intial state declared in separate files and imported)... without manually resetting all the properties of the state?

@ozeebee
Copy link

ozeebee commented Aug 7, 2017

Hi,
I had the same requirement.
I simply cloned the initial store and saved it in a variable.
Then I added a method on the store itself to "restore" the initial state based on the saved state.

@mkelley82
Copy link
Author

That's what i ended up with as well. Thanks for sharing.

@cklmercer
Copy link
Owner

ozeebee has the recommended solution! Thanks guys! glad you figured it out :)

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

3 participants