Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const getGroupsById = (state, ids) => ids.map(id => state.groups[id])
const getUsersWithGroupsById = (state, ids) => ids.map(id => ({...state.users[id], groups: getGroupsById(state.users[id].groups)}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment