title: What actually happens when persistence is enabled in Firebase?
body: <p>When turning on persistence for Firebase in iOS what actually happens to my observers and how they behave on a technical level?</p>
  
  <p>I have a good idea how it should work on a high-level based on this <a href="https://firebase.google.com/docs/database/ios/offline-capabilities" rel="nofollow noreferrer">https://firebase.google.com/docs/database/ios/offline-capabilities</a> - Firebase essentially keeps a cached copy of the data you can access whilst offline.</p>
  
  <p>What I don't understand is how many times my observers should fire and with what information.</p>
  
  <ul>
  <li>Does firebase always trigger my observers once with any cached data first (or null if there isn't any data) followed by the server data.</li>
  <li>Or does it only send the cached data if it exists followed by the server data.</li>
  <li>Is there any difference between observerSingleValue and a continous observer's behaviour when in persistence mode ?</li>
  </ul>
  
  <p>In our app with persistence enabled, I have noticed:</p>
  
  <ul>
  <li>Firebase just sending the server data</li>
  <li>Firebase sending the cached data if it exists then the server data.</li>
  <li>Firebase sending the cached data and null if it doesn't exist followed by the server data.</li>
  </ul>
  
  <p>It would be good to clear this up so we know which should be the normal behaviour :)</p>