import ActionType from '../../actions/types' // khởi tạo một init state const initialState = { isLoading: false, } // bắt từng action type function GetTimeKeepingReducer(state = initialState, action) { switch (action.type) { case ActionType.START_GET_TIME_KEEPING: return { ...state, isLoading: true, } case ActionType.GET_TIME_KEEPING_SUCCESS: return { isLoading: false, } case ActionType.GET_TIME_KEEPING_FAILED: return { ...state, isLoading: false, } default: return state } } export default GetTimeKeepingReducer