member_webapp/@overflow/member/store/container/signin/member-signin.state.ts
crusader ffb65a75f4 ing
2018-05-28 20:39:58 +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),
};
}