[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
467 B

import { denormalize } from 'normalizr'
import { createSelector } from 'reselect'
import { groupSchema } from '../store/schemas'
import { getEntityStore } from './entities'
import { AppState, Group } from '../types'
export const getGroupIds = (state: AppState) => state.directory.groups
export const getGroups = createSelector(
[getEntityStore, getGroupIds],
(store, groups) => {
return denormalize(groups, [groupSchema], store) as Group[]
}
)