Advertisement
DenysKashkovskyi

Reset redux store

Oct 21st, 2019
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const reducers = combineReducers<IRootState>({
  2.     // reducers
  3. });
  4.  
  5. const rootReducer = (state: IRootState, action: AnyAction) => {
  6.     switch (action.type) {
  7.         case getType(fullReset):
  8.             localStorage.clear();
  9.             state = { } as IRootState;
  10.     }
  11.     return reducers(state, action);
  12. };
  13.  
  14. export default rootReducer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement