import * as types from '../actions/types';

const initialState = {
  loading: false
};

const reducer = (state = initialState, action: any) => {
  switch (action.type) {
    case types.GET_COUNTRY_LIST_REQUEST:
      return { ...state, ...action.payload, loading: false };
    case types.GET_COUNTRY_LIST_SUCCESS:
    case types.GET_COUNTRY_LIST_FAIL:
      return { ...state, ...action.payload, loading: false };
    default:
      return state;
  }
};

export default reducer;
