Echo JS 0.11.0

<~>
bfred.it 2774 days ago. link 1 point
Way too many callbacks.

This should be a one-shot function like https://github.com/rndme/download that saves the file on the spot. Its post-callbacks should just be set as .then(done, errored), not passed as an option. Its before-callbacks should not be callbacks, but just functions that the user calls before `save()`

The whole thing is a bit enterprisey, including shortcut functions that are only used once, that let you write

createBlob(data, type);

instead of 

new window.Blob([data], {type});

Also .abort() doesn't really stop anything since onSave is essentially called in the frame and it doesn't abort the only asynchonous function: `saveWithFileReader`

Replies