member_webapp/@overflow/member/store/container/modify/member-modify.reducer.ts
crusader 1d0ac6b572 ing
2018-05-28 16:51:33 +09:00

39 lines
631 B
TypeScript

import {
Actions,
ActionType,
} from '../../entity/member/member.action';
import {
State,
initialState,
} from './member-modify.state';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.Modify: {
return {
pending: true,
error: null,
};
}
case ActionType.ModifySuccess: {
return {
pending: false,
error: null,
};
}
case ActionType.ModifyFailure: {
return {
pending: false,
error: action.payload,
};
}
default: {
return state;
}
}
}