next-ucap-messenger/projects/ucap-webmessenger-app/src/app/store/account/index.ts

28 lines
729 B
TypeScript
Raw Normal View History

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;
}
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
)
)
};
}