member_webapp/@overflow/probe/store/index.ts

39 lines
977 B
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
2018-05-24 06:44:13 +00:00
import { StateSelector } from '@overflow/core/ngrx/store';
2018-04-06 11:02:18 +00:00
import { MODULE } from '../probe.constant';
2018-05-25 12:41:29 +00:00
import * as ProbeEntityStore from './entity/probe';
import * as ProbeListContainerStore from './container/probe-list';
2018-04-06 11:02:18 +00:00
export interface State {
2018-05-25 12:41:29 +00:00
probes: ProbeEntityStore.State;
2018-05-25 12:52:50 +00:00
probe_list_container: ProbeListContainerStore.State;
2018-04-06 11:02:18 +00:00
}
export const REDUCERS = {
2018-05-25 12:41:29 +00:00
probes: ProbeEntityStore.reducer,
2018-05-25 12:52:50 +00:00
probe_list_container: ProbeListContainerStore.reducer,
2018-04-06 11:02:18 +00:00
};
export const EFFECTS = [
2018-05-25 12:41:29 +00:00
ProbeEntityStore.Effects,
2018-04-06 11:02:18 +00:00
];
2018-05-25 11:59:18 +00:00
export const selectState = createFeatureSelector<State>(MODULE.name);
2018-04-06 11:02:18 +00:00
2018-05-25 12:41:29 +00:00
export const ProbeSelector = ProbeEntityStore.getSelectors(createSelector(
2018-05-25 11:59:18 +00:00
selectState,
2018-05-24 10:50:43 +00:00
(state: State) => state.probes
2018-04-25 09:04:47 +00:00
));
2018-05-24 11:30:02 +00:00
2018-05-25 12:52:50 +00:00
export const ProbeListContainerSelector = ProbeListContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.probe_list_container
));