39 lines
921 B
TypeScript
39 lines
921 B
TypeScript
|
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
|
||
|
));
|