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

31 lines
700 B
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import {
createSelector,
createFeatureSelector,
} from '@ngrx/store';
import { MODULE } from '../sensor.constant';
2018-05-27 14:17:07 +00:00
import * as SensorEntityStore from './entity/sensor';
2018-05-28 10:35:06 +00:00
import * as SensorListContainerStore from './container/sensor-list';
2018-04-06 11:02:18 +00:00
export interface State {
2018-05-28 10:35:06 +00:00
sensor_list: SensorListContainerStore.State;
2018-04-06 11:02:18 +00:00
}
export const REDUCERS = {
2018-05-29 04:13:28 +00:00
sensor_list: SensorListContainerStore.reducer,
2018-04-06 11:02:18 +00:00
};
export const EFFECTS = [
2018-05-27 14:17:07 +00:00
SensorEntityStore.Effects,
2018-04-06 11:02:18 +00:00
];
2018-05-27 14:17:07 +00:00
export const selectState = createFeatureSelector<State>(MODULE.name);
2018-04-06 11:02:18 +00:00
2018-05-29 04:13:28 +00:00
export const SensorListContainerSelector = SensorListContainerStore.getSelectors(createSelector(
2018-05-27 14:17:07 +00:00
selectState,
2018-05-29 04:13:28 +00:00
(state: State) => {
return state.sensor_list;
}
2018-04-06 11:02:18 +00:00
));