19 lines
358 B
TypeScript
19 lines
358 B
TypeScript
|
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
|
||
|
)
|
||
|
};
|
||
|
}
|