2019-09-18 06:02:21 +00:00
|
|
|
import { Type } from '@angular/core';
|
|
|
|
import { Action, combineReducers, Selector, createSelector } from '@ngrx/store';
|
|
|
|
|
|
|
|
import * as AuthenticationStore from './authentication';
|
|
|
|
|
|
|
|
export interface State {
|
|
|
|
authentication: AuthenticationStore.State;
|
|
|
|
}
|
|
|
|
|
2019-10-04 01:19:55 +00:00
|
|
|
export const effects: Type<any>[] = [AuthenticationStore.Effects];
|
2019-09-18 06:02:21 +00:00
|
|
|
|
|
|
|
export function reducers(state: State | undefined, action: Action) {
|
|
|
|
return combineReducers({
|
2019-10-04 01:19:55 +00:00
|
|
|
authentication: AuthenticationStore.reducer
|
2019-09-18 06:02:21 +00:00
|
|
|
})(state, action);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function selectors<S>(selector: Selector<any, State>) {
|
|
|
|
return {
|
|
|
|
AuthenticationSelector: AuthenticationStore.selectors(
|
|
|
|
createSelector(
|
|
|
|
selector,
|
|
|
|
(state: State) => state.authentication
|
|
|
|
)
|
|
|
|
)
|
|
|
|
};
|
|
|
|
}
|