member_webapp/@overflow/sensor/store/index.ts
2018-05-28 19:35:06 +09:00

34 lines
782 B
TypeScript

import {
createSelector,
createFeatureSelector,
} from '@ngrx/store';
import { MODULE } from '../sensor.constant';
import * as SensorEntityStore from './entity/sensor';
import * as SensorListContainerStore from './container/sensor-list';
export interface State {
sensor_list: SensorListContainerStore.State;
}
export const REDUCERS = {
sensor: SensorListContainerStore.reducer,
};
export const EFFECTS = [
SensorEntityStore.Effects,
];
export const selectState = createFeatureSelector<State>(MODULE.name);
export const SensorEntitySelector = SensorListContainerStore.getSelectors(createSelector(
selectState,
(state: State) => state.sensor_list
));
export const SensorPageSelector = createSelector(
selectState,
(state: State) => state.sensor_list.page
);