member_webapp/@overflow/probe/store/index.ts
2018-05-28 18:58:13 +09:00

40 lines
1.1 KiB
TypeScript

import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import { StateSelector } from '@overflow/core/ngrx/store';
import { MODULE } from '../probe.constant';
import * as ProbeEntityStore from './entity/probe';
import * as ProbeListContainerStore from './container/probe-list';
import * as ProbeDetailContainerStore from './container/probe-detail';
export interface State {
probe_list_container: ProbeListContainerStore.State;
probe_detail_container: ProbeDetailContainerStore.State;
}
export const REDUCERS = {
probe_list_container: ProbeListContainerStore.reducer,
probe_detail_container: ProbeDetailContainerStore.reducer
};
export const EFFECTS = [
ProbeEntityStore.Effects,
];
export const selectState = createFeatureSelector<State>(MODULE.name);
export const ProbeListContainerSelector = ProbeListContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.probe_list_container
));
export const ProbeDetailContainerSelector = ProbeDetailContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.probe_detail_container
));