2018-05-28 07:51:33 +00:00
|
|
|
import { Selector, createSelector } from '@ngrx/store';
|
|
|
|
|
|
|
|
import { RESTClientError } from '@loafer/ng-rest';
|
|
|
|
|
|
|
|
export interface State {
|
2018-05-29 09:32:22 +00:00
|
|
|
signupComplete: boolean;
|
2018-05-28 07:51:33 +00:00
|
|
|
pending: boolean;
|
|
|
|
error: RESTClientError;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const initialState: State = {
|
2018-05-29 09:32:22 +00:00
|
|
|
signupComplete: false,
|
2018-05-28 07:51:33 +00:00
|
|
|
pending: false,
|
|
|
|
error: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
export function getSelectors(selector: Selector<any, State>) {
|
|
|
|
return {
|
2018-05-29 09:32:22 +00:00
|
|
|
selectSignupComplete: createSelector(selector, (state: State) => state.signupComplete),
|
2018-05-28 07:51:33 +00:00
|
|
|
selectPending: createSelector(selector, (state: State) => state.pending),
|
|
|
|
selectError: createSelector(selector, (state: State) => state.error),
|
|
|
|
};
|
|
|
|
}
|