【发布时间】:2022-01-31 01:03:42
【问题描述】:
我正在尝试了解 firebase-realtime-database。我能够获取数据,但我不知道如何添加完成块。我的意思是,是否有一个功能可以检查我的数据提取查询何时完成?
function getData() {
firebase.database().ref('SectionNames').once('value', function(names) {
names.val().forEach(function(sectionname) {
firebase.database().ref('Sections').child(sectionname).once('value').then( function(child)
//code
});
});
});
//Completion block or a method to call processData() after I get all the sections
}
function processData() {
//call this function after you get all the sections
}
非常感谢!
【问题讨论】:
标签: javascript firebase firebase-realtime-database