flowjs / flow.js

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.
Other
2.97k stars 347 forks source link

'filePaused' event #273

Closed armlesshobo closed 4 years ago

armlesshobo commented 4 years ago

I'd like to add a 'filePaused' event that gets fired when calls to Flow.pause() or FlowFile.pause() are made. The goal here is to update individual file upload progress indicators to show that a file is in a paused state as soon as the file upload is paused.

Does anyone object to this, or perhaps this can done a different way?

AidasK commented 4 years ago

I probably did this, because I use events only for async calls. This would be a sync one and you can trigger your own event instead at the same time. If we add this, there will be missing an event for every other method we have and that is a lot. It's just convenience, I don't have a strong argument for this, but you could probably trigger an event with flow.fire('pause', file)

armlesshobo commented 4 years ago

Now that I think about it, adding my own events is completely sufficient and provides the control I'm looking for. I'll do that instead. Thank you for your time.