search.ts 450 B

123456789101112
  1. import * as types from '../constants/actionTypes';
  2. const actions: ActionType = dispatch => ({
  3. setQueryString: (state: string): void =>
  4. dispatch({ type: types.SET_QUERY_STRING, payload: state }),
  5. setCurrentIndex: (state: number): void =>
  6. dispatch({ type: types.SET_CURRENT_INDEX, payload: state }),
  7. setMatchesMap: (state: MatchType[]): void =>
  8. dispatch({ type: types.SET_MATCHES_MAP, payload: state }),
  9. });
  10. export default actions;