member_webapp/@overflow/notification/store/index.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

39 lines
954 B
TypeScript

import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import { StateSelector } from '@overflow/core/ngrx/store';
import { MODULE } from '../notification.constant';
import * as ListStore from './list';
import * as DetailStore from './detail';
export interface State {
notifications: ListStore.State;
notification: DetailStore.State;
}
export const REDUCERS = {
notifications: ListStore.reducer,
notification: DetailStore.reducer,
};
export const EFFECTS = [
ListStore.Effects,
DetailStore.Effects,
];
export const selectNotificationState = createFeatureSelector<State>(MODULE.name);
export const ReadAllByMemberSelector = new StateSelector<ListStore.State>(createSelector(
selectNotificationState,
(state: State) => state.notifications
));
export const ReadSelector = new StateSelector<DetailStore.State>(createSelector(
selectNotificationState,
(state: State) => state.notification
));