I am using Redux for state management. How do I reset the store to its initial state?
For example, let’s say I have two user accounts (u1 and
u1
For me to reset the state to its initial state, I wrote the following code:
const appReducers = (state, action) => combineReducers({ reducer1, reducer2, user })( action.type === "LOGOUT" ? undefined : state, action );