flowjs / flow.js

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

Ability to pass event handlers as part of the Flow constructor #324

Closed drzraf closed 3 years ago

drzraf commented 3 years ago

Currently, a full initialization consist of the constructor, followed by event handler attachment.

I don't quite see how constructor (options, ...) would affect the behavior of fire. But on the other hand, I a real advantage into being able to pass events handlers straight from the constructor: It allows to do all the configuration with plain a object in one step before passing it to the actual instantiation of the Flow object. That means instantiation can more easily be delegated to a wrapper (Angular, VueJs, or a similar intermediary layer)

Should I provide a PR supporting this?

AidasK commented 3 years ago

Totally agree, you should be able to bind events on the initial step.