firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

UploadTask Example 3 broken

Open marcusx2 opened this issue 2 years ago • 0 comments

Operating System

macOS

Browser Version

Safari 16.5.2

Firebase SDK Version

10.7.0

Firebase SDK Product:

Storage

Describe your project's tooling

index.html with source tag. Just javascript.

Describe the problem

Example 3 is partly broken.

Steps and code to reproduce issue

This snippet is broken

var handle = uploadTask.on('state_changed');//changed from firebase.storage.TaskEvent.STATE_CHANGED
unsubscribe = handle(function(snapshot) {
  var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100;
  console.log(percent + "% done");
  // Stop after receiving one update.
  unsubscribe();
});

It does not work. I get the error undefined is not an object (evaluating 't.next'). It seems that the on method can only return Unsubscribe.

marcusx2 avatar Dec 12 '23 01:12 marcusx2