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