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 {
2019-10-08 02:19:47 +00:00
selectedRoom: string | null;
2019-09-27 03:53:21 +00:00
}
export const initialState: State = {
selectedRoom: null
};
export function selectors<S>(selector: Selector<any, State>) {
return {
selectedRoom: createSelector(
selector,
(state: State) => state.selectedRoom
)
};
}