On my dashboard page, I am currently retrieving the top 25 comments and displaying them using the following code:
fba.orderByChild('when').limitToLast(25).on('child_added', function (d, c) { stuff });
However, the function is called for each child individually. Is there a way to trigger a callback when all the calls are completed without using a Promise to wrap the entire call?
I am considering changing this block to use .once('value') at the beginning and then attach a listener for child_added with TIMESTAMP.
Would this be the recommended approach for a situation like this?