Skip to content

Instantly share code, notes, and snippets.

@danielmahal
Last active March 14, 2017 09:54
Show Gist options
  • Save danielmahal/5be30e771ef34fc63b405c90f6a7eef0 to your computer and use it in GitHub Desktop.
Save danielmahal/5be30e771ef34fc63b405c90f6a7eef0 to your computer and use it in GitHub Desktop.
{
"game": {
"1": {
"players": {
"a": true,
"b": true
}
}
},
"users": {
"a": {
"name": "Daniel"
},
"b": {
"name": "Simen"
},
"c": {
"name": "Seb"
}
}
}
// In theory:
const mapFirebaseToProps = props => ({
users: {
'a': '/users/a',
'b': '/users/b'
}
})
// In practice:
const mapFirebaseToProps = props => ({
players: mapValues(props.players, (value, key) => `users/${key}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment