mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
11 lines
373 B
TypeScript
11 lines
373 B
TypeScript
import {createSelector} from 'reselect';
|
|
import {HyperState} from './hyper';
|
|
|
|
const getTermGroups = ({termGroups}: Pick<HyperState, 'termGroups'>) => termGroups.termGroups;
|
|
const getRootGroups = createSelector(getTermGroups, termGroups =>
|
|
Object.keys(termGroups)
|
|
.map(uid => termGroups[uid])
|
|
.filter(({parentUid}) => !parentUid)
|
|
);
|
|
|
|
export default getRootGroups;
|