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-05-26 09:08:40 +00:00
|
|
|
import * as ProbeDetailContainerStore from './container/probe-detail';
|
2018-05-28 10:35:06 +00:00
|
|
|
import * as ProbeSelectorContainerStore from './container/probe-selector';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
export interface State {
|
2018-05-25 12:52:50 +00:00
|
|
|
probe_list_container: ProbeListContainerStore.State;
|
2018-05-26 09:08:40 +00:00
|
|
|
probe_detail_container: ProbeDetailContainerStore.State;
|
2018-05-28 10:35:06 +00:00
|
|
|
probe_selector_container: ProbeSelectorContainerStore.State;
|
2018-04-06 11:02:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const REDUCERS = {
|
2018-05-25 12:52:50 +00:00
|
|
|
probe_list_container: ProbeListContainerStore.reducer,
|
2018-05-28 10:35:06 +00:00
|
|
|
probe_detail_container: ProbeDetailContainerStore.reducer,
|
|
|
|
probe_selector_container: ProbeSelectorContainerStore.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:52:50 +00:00
|
|
|
export const ProbeListContainerSelector = ProbeListContainerStore.getSelectors(createSelector(
|
|
|
|
selectState,
|
|
|
|
(state: State) => state.probe_list_container
|
|
|
|
));
|
2018-05-26 09:08:40 +00:00
|
|
|
|
|
|
|
export const ProbeDetailContainerSelector = ProbeDetailContainerStore.getSelectors(createSelector(
|
|
|
|
selectState,
|
|
|
|
(state: State) => state.probe_detail_container
|
|
|
|
));
|
2018-05-28 10:35:06 +00:00
|
|
|
|
|
|
|
export const ProbeSelectorContainerSelector = ProbeSelectorContainerStore.getSelectors(createSelector(
|
|
|
|
selectState,
|
|
|
|
(state: State) => state.probe_selector_container
|
|
|
|
));
|