member_webapp/@overflow/member/store/container/signout/member-signout.reducer.ts

45 lines
818 B
TypeScript
Raw Normal View History

2018-05-28 07:51:33 +00:00
import {
Actions as MemberActions,
ActionType as MemberActionType,
} from '../../entity/member/member.action';
import {
State,
initialState,
} from './member-signout.state';
import {
Actions as AuthActions,
ActionType as AuthActionType,
} from '@overflow/shared/auth/store/container/auth';
export function reducer(state = initialState, action: MemberActions | AuthActions): State {
switch (action.type) {
case MemberActionType.Signout: {
return {
pending: true,
error: null,
};
}
case AuthActionType.SignoutSuccess: {
return {
pending: false,
error: null,
};
}
case AuthActionType.SignoutFailure: {
return {
pending: false,
error: null,
};
}
default: {
return state;
}
}
}