2018-04-06 11:02:18 +00:00
|
|
|
import {
|
|
|
|
createSelector,
|
|
|
|
createFeatureSelector,
|
|
|
|
} from '@ngrx/store';
|
|
|
|
|
|
|
|
import { MODULE } from '../notification.constant';
|
|
|
|
|
2018-05-27 09:12:20 +00:00
|
|
|
import * as NotificationEntityStore from './entity/notification';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
export interface State {
|
2018-05-27 09:12:20 +00:00
|
|
|
notification: NotificationEntityStore.State;
|
2018-04-06 11:02:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const REDUCERS = {
|
2018-05-27 09:12:20 +00:00
|
|
|
notification: NotificationEntityStore.reducer,
|
2018-04-06 11:02:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const EFFECTS = [
|
2018-05-27 09:12:20 +00:00
|
|
|
NotificationEntityStore.Effects,
|
2018-04-06 11:02:18 +00:00
|
|
|
];
|
|
|
|
|
2018-05-27 09:12:20 +00:00
|
|
|
export const selectState = createFeatureSelector<State>(MODULE.name);
|
2018-04-06 11:02:18 +00:00
|
|
|
|
2018-05-27 09:12:20 +00:00
|
|
|
export const NotificationEntitySelector = NotificationEntityStore.getSelectors(createSelector(
|
|
|
|
selectState,
|
2018-04-06 11:02:18 +00:00
|
|
|
(state: State) => state.notification
|
|
|
|
));
|