Good afternoon. I'm new to working with Firebase batabase. Please tell me how to get data from my database to work with them farther. Now my function returns Promise {} with the date that I need inside PromiseValue. How do I get it right. Now my code looks like this
let firebaseConfig = {
....
};
firebase.initializeApp(firebaseConfig);
let ref = firebase.database().ref('/data')
function getDataPromise() {
return ref.once('value').then(function(snapshot) {
return snapshot.val();
});
}
let res = getDataPromise()
console.log(res)
I will be glad to any answer