Skip to content

Instantly share code, notes, and snippets.

@kaueDM
Last active June 23, 2017 23:32
Show Gist options
  • Save kaueDM/43eac7290be0d8d907935f17858045ef to your computer and use it in GitHub Desktop.
Save kaueDM/43eac7290be0d8d907935f17858045ef to your computer and use it in GitHub Desktop.
const getAll = (userUID) => {
return new Promise((resolve, reject) => {
const ref = database
.ref('user_data')
.child(userUID)
.child('customers')
.on('value', snap => {
(snap.val() ? resolve(snap.val()) : reject({'message': 'Empty Firebase node'}))
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment