next-ucap-messenger/projects/ucap-webmessenger-app/src/app/store/messenger/chat/state.ts

19 lines
358 B
TypeScript
Raw Normal View History

2019-09-27 03:53:21 +00:00
import { Selector, createSelector } from '@ngrx/store';
export interface State {
selectedRoom: number | null;
}
export const initialState: State = {
selectedRoom: null
};
export function selectors<S>(selector: Selector<any, State>) {
return {
selectedRoom: createSelector(
selector,
(state: State) => state.selectedRoom
)
};
}