importActionTypefrom'../../actions/types'// khởi tạo một init stateconstinitialState={userInfo:[],isLoading:false,}// bắt từng action typefunctionUserInfoReducer(state=initialState,action){switch(action.type){caseActionType.START_GET_USER_INFO:return{...state,isLoading:true,}caseActionType.GET_USER_INFO_SUCCESS:return{userInfo:action.data,isLoading:false,}caseActionType.GET_USER_INFO_FAILED:return{...state,isLoading:false,}caseActionType.EDIT_USER_INFO_SUCCESS:return{...state,userInfo:action.data,}default:returnstate}}exportdefaultUserInfoReducer