member_webapp/@overflow/member/store/index.ts
2018-06-01 17:21:15 +09:00

49 lines
1.5 KiB
TypeScript

import {
createSelector,
createFeatureSelector,
} from '@ngrx/store';
import { MODULE } from '../member.constant';
import * as MemberEntityStore from './entity/member';
import * as MemberTOTPEntityStore from './entity/member-totp';
import * as MemberSigninContainerStore from './container/signin';
import * as MemberModifyContainerStore from './container/modify';
import * as MemberSignoutContainerStore from './container/signout';
export interface State {
member_signin_container: MemberSigninContainerStore.State;
member_modify_container: MemberModifyContainerStore.State;
member_signout_container: MemberSignoutContainerStore.State;
}
export const REDUCERS = {
member_signin_container: MemberSigninContainerStore.reducer,
member_modify_container: MemberModifyContainerStore.reducer,
member_signout_container: MemberSignoutContainerStore.reducer,
};
export const EFFECTS = [
MemberEntityStore.Effects,
MemberTOTPEntityStore.Effects,
];
export const selectState = createFeatureSelector<State>(MODULE.name);
export const MemberSigninContainerSelector = MemberSigninContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.member_signin_container
));
export const MemberModifyContainerSelector = MemberModifyContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.member_modify_container
));
export const MemberSignoutContainerSelector = MemberSignoutContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.member_signout_container
));