Hey, I'm in a bit of a pickle trying to retrieve the values returned by my function. I can see them just fine in the console log, but how do I actually access them when calling the function?
function getprofile(useruid) {
return firebase.database().ref('users/'+useruid+'/')
.once('value')
.then(function(bref) {
var username= bref.val().username;
var provider= bref.val().provider;
var submitedpic=bref.val().profilepic;
var storageRef = firebase.storage().ref();
console.log("The current ID is: "+useruid+" and the current username is: "+username+'/provider is: '+provider+'/pic is :'+submitedpic);
});
}
When calling my function, I use this:
getprofile(userid);