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
This approach is very right: Destruct any specific state "NAME" to ignore and keep others.
const rootReducer = (state, action) => { if (action.type === 'USER_LOGOUT') { state.NAME = undefined } return appReducer(state, action) }