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

35 lines
780 B
TypeScript

import { Selector, createSelector } from '@ngrx/store';
export interface State {
selectedRoom: string | null;
selectedMassDetail: number | null;
massDetailProcessing: boolean;
selectedRightDrawer: string | null;
}
export const initialState: State = {
selectedRoom: null,
selectedMassDetail: null,
massDetailProcessing: false,
selectedRightDrawer: ''
};
export function selectors<S>(selector: Selector<any, State>) {
return {
selectedRoom: createSelector(
selector,
(state: State) => state.selectedRoom
),
selectedMassDetail: createSelector(
selector,
(state: State) => state.selectedMassDetail
),
selectedRightDrawer: createSelector(
selector,
(state: State) => state.selectedRightDrawer
)
};
}