SHARE
TWEET

Reset redux store

DenysKashkovskyi Oct 21st, 2019 (edited) 73 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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top