index.ts 368 B

123456789101112131415161718
  1. import { SET_SIDEBAR, SET_TOOL } from '../../constants/actionTypes';
  2. const applyMiddleware = (dispatch: DispatchType) => (
  3. action: DispatchObjType,
  4. ): void => {
  5. dispatch(action);
  6. switch (action.type) {
  7. case SET_SIDEBAR: {
  8. dispatch({ type: SET_TOOL, payload: '' });
  9. break;
  10. }
  11. default:
  12. break;
  13. }
  14. };
  15. export default applyMiddleware;