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;
|
2019-11-11 05:31:26 +00:00
|
|
|
|
|
|
|
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,
|
2019-11-11 05:31:26 +00:00
|
|
|
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
|
2019-11-11 05:31:26 +00:00
|
|
|
),
|
|
|
|
selectedRightDrawer: createSelector(
|
|
|
|
selector,
|
|
|
|
(state: State) => state.selectedRightDrawer
|
2019-09-27 03:53:21 +00:00
|
|
|
)
|
|
|
|
};
|
|
|
|
}
|