123456789101112131415161718192021222324252627282930 |
- import * as types from "../../constants/index";
- import initialState from '../initialState';
- export default function getUser(state = initialState.getUser, {type, payload: data, error }) {
- switch (type) {
- case types.USER_GET_REQUEST: {
- return {
- ...state,
- isFetching: true
- }
- }
- case types.USER_GET_REQUEST_SUCCESS: {
- return {
- ...state,
- isFetching: false,
- data
- }
- }
- case types.USER_GET_REQUEST_FAILURE: {
- return {
- ...state,
- isFetching: false,
- error
- }
- }
- default: {
- return state
- }
- }
- }
|