Skip to content

Instantly share code, notes, and snippets.

@jonra1993
Last active March 14, 2021 19:39
Show Gist options
  • Save jonra1993/702ccf4a7847d89268856fd4d41ea46c to your computer and use it in GitHub Desktop.
Save jonra1993/702ccf4a7847d89268856fd4d41ea46c to your computer and use it in GitHub Desktop.
import { combineReducers } from '@reduxjs/toolkit';
import { reducer as counterReducer } from 'src/redux/slices/counter';
const appReducer = combineReducers({
counter: counterReducer,
});
const rootReducer = (state, action) => {
if (action.type === 'RESET_WEBAPP') {
state = undefined;
}
return appReducer(state, action);
}
export const resetAppAction = () => (dispatch) => {
dispatch({ type: 'RESET_WEBAPP' });
};
export default rootReducer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment