-
Notifications
You must be signed in to change notification settings - Fork 962
Closed
Labels
Description
[REQUIRED] Describe your environment
- Operating System version: Linux & Windows 10
- Firebase SDK version: 4.1.1
- Firebase Product: storage
[REQUIRED] Describe the problem
According to the documentation, the nextOrObserver
parameter for the firebase.storage.UploadTask#on
method should accept an observer with only some of the methods: next
, complete
, and error
.
That means this should be allowed:
uploadTask.on(TaskEvent.STATE_CHANGED, {
next: (snapshot) => { console.log(snapshot); },
error: (err) => { console.error(err); }
});
This, though, raises the following error: TypeError: Cannot read property 'bind' of undefined
since observer.complete
is undefined
. Relevant code here.
Currently, the only workaround besides providing an actual method is this:
uploadTask.on(TaskEvent.STATE_CHANGED, {
next: (snapshot) => { console.log(snapshot); },
error: (err) => { console.error(err); },
complete: null
});
Steps to reproduce:
See JS Bin link below.