import * as types from '../constants/actionTypes';

const actions: ActionType = dispatch => ({
  setQueryString: (state: string): void =>
    dispatch({ type: types.SET_QUERY_STRING, payload: state }),
  setCurrentIndex: (state: number): void =>
    dispatch({ type: types.SET_CURRENT_INDEX, payload: state }),
  setMatchesMap: (state: MatchType[]): void =>
    dispatch({ type: types.SET_MATCHES_MAP, payload: state }),
});

export default actions;
