member_webapp/src/packages/member/store/signup/signup.action.ts

36 lines
838 B
TypeScript
Raw Normal View History

2018-04-06 06:59:49 +00:00
import { Action } from '@ngrx/store';
import { RESTClientError } from '@loafer/ng-rest/protocol';
2018-05-02 08:09:39 +00:00
import { Member } from '@overflow/commons-typescript/model/member';
2018-04-06 06:59:49 +00:00
export enum ActionType {
Signup = '[member.signup] Signup',
SignupSuccess = '[member.signup] SignupSuccess',
SignupFailure = '[member.signup] SignupFailure',
}
export class Signup implements Action {
readonly type = ActionType.Signup;
2018-04-12 08:06:15 +00:00
constructor(public payload: {member: Member, password: string}) {}
2018-04-06 06:59:49 +00:00
}
export class SignupSuccess implements Action {
readonly type = ActionType.SignupSuccess;
constructor(public payload: Member) {}
}
export class SignupFailure implements Action {
readonly type = ActionType.SignupFailure;
constructor(public payload: RESTClientError) {}
}
export type Actions =
| Signup
| SignupSuccess
| SignupFailure
;