import ActionType from '../../actions/types'
// khởi tạo một init state
const initialState = {
isLoading: false,
}
// bắt từng action type
function GetDataChart(state = initialState, action) {
switch (action.type) {
case ActionType.START_GET_DATA_CHART:
return {
...state,
isLoading: true,
}
case ActionType.GET_DATA_CHART_SUCCESS:
return {
isLoading: false,
}
case ActionType.GET_DATA_CHART_FAILED:
return {
...state,
isLoading: false,
}
default:
return state
}
}
export default GetDataChart
-
quynhquang400@gmail.com authoredf8f966b3