1234567891011121314151617181920 |
- import { Dispatch } from 'react';
- import { SET_SIDEBAR, SET_TOOL } from '../../constants/actionTypes';
- const applyMiddleware = (dispatch: Dispatch<any>) => (action: {
- type: string;
- payload?: any;
- }): void => {
- dispatch(action);
- switch (action.type) {
- case SET_SIDEBAR: {
- dispatch({ type: SET_TOOL, payload: '' });
- break;
- }
- default:
- break;
- }
- };
- export default applyMiddleware;
|