member_webapp/@overflow/member/store/container/signup/member-signup.reducer.ts
2018-05-29 18:32:22 +09:00

42 lines
723 B
TypeScript

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