member_webapp/@overflow/sensor/store/index.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

40 lines
865 B
TypeScript

import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import { StateSelector } from '@overflow/core/ngrx/store';
import { MODULE } from '../sensor.constant';
import * as ListStore from './list';
import * as DetailStore from './detail';
export interface State {
list: ListStore.State;
sensor: DetailStore.State;
}
export const REDUCERS = {
list: ListStore.reducer,
sensor: DetailStore.reducer,
};
export const EFFECTS = [
ListStore.Effects,
DetailStore.Effects,
];
export const sensorState = createFeatureSelector<State>(MODULE.name);
export const sensorListSelector = new StateSelector<ListStore.State>(createSelector(
sensorState,
(state: State) => state.list
));
export const sensorSelector = new StateSelector<DetailStore.State>(createSelector(
sensorState,
(state: State) => state.sensor
));