Created
January 31, 2018 10:53
-
-
Save ArturoRodriguezRomero/00c5468abb9209c81c10d0bebf494baa to your computer and use it in GitHub Desktop.
Firebase Snapshot to JavaScript Array (ES6)
This file contains hidden or 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
| function snapshotToArray(snapshot) { | |
| let returnArr = []; | |
| snapshot.forEach(childSnapshot => { | |
| let item = childSnapshot.val(); | |
| item.key = childSnapshot.key; | |
| returnArr.push(item); | |
| }); | |
| return returnArr; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
briliant! Thanks!