Last active
March 14, 2017 09:54
-
-
Save danielmahal/5be30e771ef34fc63b405c90f6a7eef0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"game": { | |
"1": { | |
"players": { | |
"a": true, | |
"b": true | |
} | |
} | |
}, | |
"users": { | |
"a": { | |
"name": "Daniel" | |
}, | |
"b": { | |
"name": "Simen" | |
}, | |
"c": { | |
"name": "Seb" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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