member_webapp/@overflow/member/store/container/signup/member-signup.state.ts
2018-05-29 20:42:39 +09:00

25 lines
668 B
TypeScript

import { Selector, createSelector } from '@ngrx/store';
import { RESTClientError } from '@loafer/ng-rest';
import { Member } from '@overflow/commons-typescript/model/member';
export interface State {
member: Member;
pending: boolean;
error: RESTClientError;
}
export const initialState: State = {
member: null,
pending: false,
error: null,
};
export function getSelectors(selector: Selector<any, State>) {
return {
selectMember: createSelector(selector, (state: State) => state.member),
selectPending: createSelector(selector, (state: State) => state.pending),
selectError: createSelector(selector, (state: State) => state.error),
};
}