hyper/builder/lib/selectors.ts
2025-08-10 02:06:07 -04:00

10 lines
368 B
TypeScript

import {createSelector} from 'reselect';
import type {HyperState} from '../typings/hyper';
const getTermGroups = ({termGroups}: Pick<HyperState, 'termGroups'>) => termGroups.termGroups;
export const getRootGroups = createSelector(getTermGroups, (termGroups) =>
Object.keys(termGroups)
.map((uid) => termGroups[uid])
.filter(({parentUid}) => !parentUid)
);