Is there a way to make a realtime ForEach in Firebase?
<p>I have been using <a href="https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#forEach" rel="nofollow">ForEach</a> to populate my HTML table. </p>

<p>So far so good but the table is not realtime. I have to reload the function for it to fetch the results again. If I add or delete an entry nothing happens VISUALLY until I reload.</p>

<p>Is there a way to make this realtime?
Code from Firebase Docs: </p>

<pre><code>var query = firebase.database().ref("users").orderByKey();
query.once("value")
.then(function(snapshot) {
snapshot.forEach(function(childSnapshot) {
  // key will be "ada" the first time and "alan" the second time
  var key = childSnapshot.key;
  // childData will be the actual contents of the child
  var childData = childSnapshot.val();
});
});
</code></pre>

<p>Please excuse my poor knowledge on JS, I am working on it.</p>