Skip to content

Instantly share code, notes, and snippets.

@lubien
Forked from kaueDM/get.js
Last active June 23, 2017 23:43
Show Gist options
  • Save lubien/82a431ed99194fc0ab6a5a09751bfb81 to your computer and use it in GitHub Desktop.
Save lubien/82a431ed99194fc0ab6a5a09751bfb81 to your computer and use it in GitHub Desktop.
const getAll = userUID =>
database
.ref('user_data')
.child(userUID)
.child('customers')
// exemplo de uso:
getAll(myUserId).on('value', snap => {
const value = snap.val()
if (value) {
// do something
} else {
console.error({message: 'Empty Firebase node'})
// do something
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment