member_webapp/@overflow/member/store/container/email-auth/email-auth.state.ts

24 lines
694 B
TypeScript
Raw Normal View History

2018-05-31 10:20:14 +00:00
import { Selector, createSelector } from '@ngrx/store';
import { RESTClientError } from '@loafer/ng-rest';
import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth';
export interface State {
emailAuth: EmailAuth;
pending: boolean;
error: RESTClientError;
}
export const initialState: State = {
emailAuth: null,
pending: false,
error: null,
};
export function getSelectors(selector: Selector<any, State>) {
return {
selectEmailAuth: createSelector(selector, (state: State) => state.emailAuth),
selectPending: createSelector(selector, (state: State) => state.pending),
selectError: createSelector(selector, (state: State) => state.error),
};
}