Firebase run script after retrieving existing data
<p>I have a function in js that needs to refresh after I retrieve data from Firebase.</p>

<pre><code>firebase.database().ref('/users/' + this.userId + '/info').on('child_added', function(snapshot){
    this.myFunction();
}.bind(this));
</code></pre>

<p>The problem is that the data in Firebase is very large so I don't what to run the function lots of times. This is how I what it to run:</p>

<ol>
<li>Retrieve ALL EXISTING data from Firebase.</li>
<li>Run the function (once).</li>
<li>Every time more data comes in from Firebase, run the function again.</li>
</ol>

<p>Is this possible?</p>

<p>Thanks.</p>