member_webapp/@overflow/probe/store/index.ts
2018-05-25 21:52:50 +09:00

39 lines
977 B
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';
export interface State {
probes: ProbeEntityStore.State;
probe_list_container: ProbeListContainerStore.State;
}
export const REDUCERS = {
probes: ProbeEntityStore.reducer,
probe_list_container: ProbeListContainerStore.reducer,
};
export const EFFECTS = [
ProbeEntityStore.Effects,
];
export const selectState = createFeatureSelector<State>(MODULE.name);
export const ProbeSelector = ProbeEntityStore.getSelectors(createSelector(
selectState,
(state: State) => state.probes
));
export const ProbeListContainerSelector = ProbeListContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.probe_list_container
));