session-desktop/ts/state/selectors/section.ts

23 lines
751 B
TypeScript
Raw Normal View History

import { createSelector } from 'reselect';
import { StateType } from '../reducer';
2021-07-07 05:43:33 +02:00
import { SectionStateType, SectionType } from '../ducks/section';
import { SessionSettingCategory } from '../../components/session/settings/SessionSettings';
export const getSection = (state: StateType): SectionStateType => state.section;
export const getFocusedSection = createSelector(
getSection,
(state: SectionStateType): SectionType => state.focusedSection
);
export const getFocusedSettingsSection = createSelector(
getSection,
2021-04-22 10:03:58 +02:00
(state: SectionStateType): SessionSettingCategory | undefined => state.focusedSettingsSection
);
export const getIsAppFocused = createSelector(
getSection,
(state: SectionStateType): boolean => state.isAppFocused
);