member_webapp/@overflow/member/store/container/signin/signin.reducer.ts

49 lines
803 B
TypeScript
Raw Normal View History

2018-05-28 05:41:56 +00:00
import {
Actions,
ActionType,
} from '../../entity/member/member.action';
import {
State,
initialState,
} from './signin.state';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.Signin: {
return {
pending: true,
};
}
case ActionType.SigninSuccess: {
const domainMember = action.payload.domainMember;
return {
pending: false,
};
}
case ActionType.SigninFailure: {
return {
pending: false,
};
}
case ActionType.SigninCookieSuccess: {
return {
pending: false,
};
}
case ActionType.SigninCookieFailure: {
return {
pending: false,
};
}
default: {
return state;
}
}
}