[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
474 B

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