title: Dynamic progress bar for Firebase Storage Upload
body: <p>My problem is that I can't get <code>firebase.storage.UploadTaskSnapshot.bytesTransferred</code> directly from <code>firebasePutString</code>, but need to use the <code>.on("state_changed")</code> method, but this method is called only every few seconds (every 256Kb), so the progress bar isn't really dynamic. I can't figure out how to call it directly from my <code>firebasePutString</code> object. Any ideas??</p>
  
  <pre><code>let firebasePutString = firebase.storage().ref(`/${UID}/${fileName}`).putString(data, 'data_url');
  firebasePutString.on('state_changed',
  function progress(snapshot) {
    console.log("snapshot: " + snapshot);
    this.percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
    console.log("percentage2: " + this.percentage);
  },
  function error(err) {},
  function complete() {});
  </code></pre>