Skip to content

Instantly share code, notes, and snippets.

@javebratt
Created August 23, 2018 00:11
Show Gist options
  • Save javebratt/6e72d5f5cd40d8c8865e2319a305b459 to your computer and use it in GitHub Desktop.
Save javebratt/6e72d5f5cd40d8c8865e2319a305b459 to your computer and use it in GitHub Desktop.
getUserProfile(): Promise<firebase.database.Reference> {
return new Promise((resolve, reject) => {
firebase.auth().onAuthStateChanged(user => {
if (user) {
const userProfile = firebase.database().ref(`/userProfile/${user.uid}`);
resolve(userProfile)
} else {
reject(false)
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment