member_webapp/src/packages/probe/store/index.ts

39 lines
921 B
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import { StateSelector } from 'packages/core/ngrx/store';
import { MODULE } from '../probe.constant';
import * as ProbeListStore from './list';
import * as ProbeDetailStore from './detail';
export interface State {
list: ProbeListStore.State;
detail: ProbeDetailStore.State;
}
export const REDUCERS = {
list: ProbeListStore.reducer,
detail: ProbeDetailStore.reducer,
};
export const EFFECTS = [
ProbeListStore.Effects,
ProbeDetailStore.Effects,
];
export const selectProbeState = createFeatureSelector<State>(MODULE.name);
export const ListSelector = new StateSelector<ProbeListStore.State>(createSelector(
selectProbeState,
(state: State) => state.list
));
export const DetailSelector = new StateSelector<ProbeDetailStore.State>(createSelector(
selectProbeState,
(state: State) => state.detail
));