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
Just a simplified answer to the best answer:
const rootReducer = combineReducers({ auth: authReducer, ...formReducers, routing }); export default (state, action) => rootReducer(action.type === 'USER_LOGOUT' ? undefined : state, action);