port js files in lib and lib/containers to ts (#3957)
* rename files in lib and lib/containers to ts * add types * fix ts errors
This commit is contained in:
parent
d5d5bcc74c
commit
a1eb84d8a7
17 changed files with 163 additions and 59 deletions
13
lib/selectors.ts
Normal file
13
lib/selectors.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue