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

35 lines
780 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-10-11 09:03:01 +00:00
selectedMassDetail: number | null;
massDetailProcessing: boolean;
selectedRightDrawer: string | null;
2019-09-27 03:53:21 +00:00
}
export const initialState: State = {
2019-10-11 09:03:01 +00:00
selectedRoom: null,
selectedMassDetail: null,
massDetailProcessing: false,
selectedRightDrawer: ''
2019-09-27 03:53:21 +00:00
};
export function selectors<S>(selector: Selector<any, State>) {
return {
selectedRoom: createSelector(
selector,
(state: State) => state.selectedRoom
2019-10-11 09:03:01 +00:00
),
selectedMassDetail: createSelector(
selector,
(state: State) => state.selectedMassDetail
),
selectedRightDrawer: createSelector(
selector,
(state: State) => state.selectedRightDrawer
2019-09-27 03:53:21 +00:00
)
};
}