You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is what I think it should look like (I have seen this pattern somewhere but cannot find it, it would be good to have a reference):
uploader.upload(file) shoudl return a Promise (as it already does) that is also an EventEmitter.
So that means that the usage pattern would be something like this:
let foo = uploader.upload(file)
// foo is a promise that is pedning until uploading and transcoding is finished
i // foo is also an EventEmitter that emits events relative to this upload, that can be subscribed to
foo.on('UploadFinished', dosomething)
foo.on('Progress', function(progress) { console.log(progress })
This is nicer than what we have now (passing callbacks for each event), and just as easy to program (instead of calling onSomething(...args) in the code, we write `promsie.emit('Something', ...args)
The text was updated successfully, but these errors were encountered:
Here is what I think it should look like (I have seen this pattern somewhere but cannot find it, it would be good to have a reference):
uploader.upload(file)
shoudl return aPromise
(as it already does) that is also anEventEmitter
.So that means that the usage pattern would be something like this:
i // foo is also an EventEmitter that emits events relative to this upload, that can be subscribed to
foo.on('UploadFinished', dosomething)
foo.on('Progress', function(progress) { console.log(progress })
This is nicer than what we have now (passing callbacks for each event), and just as easy to program (instead of calling
onSomething(...args)
in the code, we write `promsie.emit('Something', ...args)The text was updated successfully, but these errors were encountered: