-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to reset the store. #146
Comments
Any update? |
You can add a |
@revskill10 We tried that, but it didn't make any change. |
As a temporary solution you could do something similar to: const store = createStore({
...,
setState: action((state, payload) => payload),
});
const initialState = store.getState();
// Later... reset store
store.dispatch.setState(initialState); |
And if you would like it wrapped in an action... let initialState = {}
const store = createStore({
...,
reset: action((state, payload) => ({
...initialState,
}),
});
initialState = store.getState();
// Later... reset store
store.dispatch.reset(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the application that we're building, after the user logs out, there's no way to reset the store.
We have tried setting it to undefined,null or an empty object(it crashes the app), but that doesn't help.
The text was updated successfully, but these errors were encountered: