2018-04-06 11:02:18 +00:00
|
|
|
import {
|
|
|
|
createSelector,
|
|
|
|
createFeatureSelector,
|
|
|
|
} from '@ngrx/store';
|
|
|
|
|
2018-05-24 06:44:13 +00:00
|
|
|
import { StateSelector } from '@overflow/core/ngrx/store';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
import { MODULE } from '../notification.constant';
|
|
|
|
|
2018-05-25 03:31:08 +00:00
|
|
|
import * as NotificationStore from './notification';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
export interface State {
|
2018-05-25 03:31:08 +00:00
|
|
|
notification: NotificationStore.State;
|
2018-04-06 11:02:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const REDUCERS = {
|
2018-05-25 03:31:08 +00:00
|
|
|
notification: NotificationStore.reducer,
|
2018-04-06 11:02:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const EFFECTS = [
|
2018-05-25 03:31:08 +00:00
|
|
|
NotificationStore.Effects,
|
2018-04-06 11:02:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
export const selectNotificationState = createFeatureSelector<State>(MODULE.name);
|
|
|
|
|
2018-05-25 03:31:08 +00:00
|
|
|
export const NotificationSelector = new StateSelector<NotificationStore.State>(createSelector(
|
2018-04-06 11:02:18 +00:00
|
|
|
selectNotificationState,
|
|
|
|
(state: State) => state.notification
|
|
|
|
));
|