main.ts 727 B

123456789101112131415161718
  1. import * as types from '../constants/actionTypes';
  2. const actions: ActionType = dispatch => ({
  3. toggleDisplayMode: (state: string): void =>
  4. dispatch({ type: types.TOGGLE_DISPLAY_MODE, payload: state }),
  5. setNavbar: (state: string): void =>
  6. dispatch({ type: types.SET_NAVBAR, payload: state }),
  7. setSidebar: (state: string): void =>
  8. dispatch({ type: types.SET_SIDEBAR, payload: state }),
  9. setTool: (state: string): void =>
  10. dispatch({ type: types.SET_TOOL, payload: state }),
  11. setInfo: (state: Record<string, any>): void =>
  12. dispatch({ type: types.SET_INFO, payload: state }),
  13. setLoading: (state: boolean): void =>
  14. dispatch({ type: types.SET_LOADING, payload: state }),
  15. });
  16. export default actions;