Echo JS 0.11.0

<~>

tquetano-r7 comments

tquetano-r7 2752 days ago. link 1 point
Everything is promise-based (they aren't callbacks), but there are optional hooks to allow the developer to have another way to do accomplish their goals. What you describe is a perfectly logical way to process, but not the only way, and this gives more options to the developer.

It's a valid point about the one-shot function example ... I wrote the partial application setup because of the AJAX use specifically, but its far from the only use-case. I just released 1.1.0 that has a convenience function to satisfy just that:

import savery from 'savery';

savery.save(data, filename, options);

Another valid point about the abort function, and the problem was centered around the creation of the file vs the actual saving mechanism being coupled. As such, I have abstracted out the blob creation into a separate step in the chain, so the abort function has until the actual download trigger to prevent the save from operating.

Couple other things...

The return from either .save() call is a Promise of the saving lifecycle, so the .then() / catch you are looking for is already available. I've updated the documentation to reflect this.

I don't really know what to say about the "enterprisey" comment ... I'm sorry you don't like my code style? The small dedicated functions are for testability, and are just kind of a (I consider good) habit borne out of functional programming as a whole.

Anyways, appreciate the feedback, this is obviously in its infancy and any aide in its progress is welcome.