Closed victornpb closed 5 years ago
on this line: if(typeof cbo!=="object" || typeof cbo.done==="function" || typeof cbo.fail==="function") throw new Error("You must specify a callback.done and callback.fail");
Are you sure you meant to throw an error if done and fail ARE functions?
also it seems that on line 121, it should be 'cbo.progress.call(xhr, {' ( not onprogress.call )
I'm making these adjustments, I have to rebase first I'm 2 behind. Sorry about the late reply, this notification got lost in the middle of all the other ones, I was looking at old stuff and stumbled here.
Can you review my latest changes?
Added support for download progress. For that I implemented a extensible callback style with object props, inspired by jQuery.
NOTE: Old callback still supported. But, if you want to use the progress status you'll need to switch to the new syntax.
I updated the QUnit to v2, as it is easier to test async code, they deprecated start/stop and global functions.
I also returned the xhr object, so one can still attach other events to it if they want to implement things like progress on their own.
Edit: After the PR Review, we settled at a new API favoring Promise support.
Old syntax still supported, but you don't get any new functionality.
Callback style
Promise style
async await