28 lines
729 B
TypeScript
28 lines
729 B
TypeScript
|
import { Type } from '@angular/core';
|
||
|
import { Action, combineReducers, Selector, createSelector } from '@ngrx/store';
|
||
|
|
||
|
import * as AuthenticationStore from './authentication';
|
||
|
|
||
|
export interface State {
|
||
|
authentication: AuthenticationStore.State;
|
||
|
}
|
||
|
|
||
|
export const effects: Type<any>[] = [AuthenticationStore.Effects];
|
||
|
|
||
|
export function reducers(state: State | undefined, action: Action) {
|
||
|
return combineReducers({
|
||
|
authentication: AuthenticationStore.reducers
|
||
|
})(state, action);
|
||
|
}
|
||
|
|
||
|
export function selectors<S>(selector: Selector<any, State>) {
|
||
|
return {
|
||
|
AuthenticationSelector: AuthenticationStore.selectors(
|
||
|
createSelector(
|
||
|
selector,
|
||
|
(state: State) => state.authentication
|
||
|
)
|
||
|
)
|
||
|
};
|
||
|
}
|