21 lines
473 B
TypeScript
Raw Normal View History

2019-09-24 09:23:30 +09:00
import { Selector, createSelector } from '@ngrx/store';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
2019-09-18 15:02:21 +09:00
// tslint:disable-next-line: no-empty-interface
2019-09-24 09:23:30 +09:00
export interface State {
2019-10-04 10:19:55 +09:00
loginRes: LoginResponse | null;
2019-09-24 09:23:30 +09:00
}
2019-09-18 15:02:21 +09:00
2019-09-24 09:23:30 +09:00
export const initialState: State = {
2019-10-04 10:19:55 +09:00
loginRes: null
2019-09-24 09:23:30 +09:00
};
2019-09-18 15:02:21 +09:00
export function selectors<S>(selector: Selector<any, State>) {
2019-09-24 09:23:30 +09:00
return {
2019-10-04 10:19:55 +09:00
loginRes: createSelector(
2019-09-24 09:23:30 +09:00
selector,
2019-10-04 10:19:55 +09:00
(state: State) => state.loginRes
2019-09-24 09:23:30 +09:00
)
};
2019-09-18 15:02:21 +09:00
}