redux-symbiote
redux-symbiote copied to clipboard
Store reset
When user logs out, I want to clear the store with one RESET_STORE action. It's easy to achieve with pure Redux. Is there an elegant way to reset the whole state to initial values with one action, when using redux-symbiote with namespaces?
You can use defaultReducer, to handle your case. I going to think about better API
What about that API:
createSymbiote(initialState, symbiotes, {
reset: RESET_ACTION,
})
When RESET_ACTION
is a global action type.
Actually I don't think it's necessary, I'm pretty satisfied with the "defaultReducer" solution :) A more detailed description in the documentation will be sufficient for me.