Skip to content

Instantly share code, notes, and snippets.

@baptistemanson
Last active July 20, 2017 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baptistemanson/6fb75e345855ac7268e78ca4b4d97a87 to your computer and use it in GitHub Desktop.
Save baptistemanson/6fb75e345855ac7268e78ca4b4d97a87 to your computer and use it in GitHub Desktop.
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