-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split progress event handlers into upload and download. #423
Conversation
// as well as 'GET' downloads | ||
progress: function (progressEvent) { | ||
// `progressUpload` allows handling of progress events for uploads | ||
progressUpload: function (progressEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to rename progressUpload
and progressDownload
to onUploadProgress
and onDownloadProgress
respectively.
… events before attaching. Updated tests to use Spies.
@nickuraltsev the Jasmine AJAX fakeXHR hasn't implemented upload events. So i can't do any tests on that yet. I'm gonna create an issue/PR over there so we can test this properly, not sure if you wanna wait for that before merging this. In the meantime i've switched the tests to use spies which is much nicer. |
@diesal11 Thank you! Could you please also rename the config options in README.md? Everything else looks good to me. |
@diesal11 Merged. Thank you for the PR! |
Splits progress config into two options,
progressDownload
andprogressUpload
. No longer limits these toGET
/POST
/PUT
requests.Previously there were no tests for progress handling...so i've added some. But testing is difficult as the Jasmine-AJAX plugin doesn't handle
xhr.upload.addEventListener
correctly. Im also not overly familiar with Jasmine and it's tools so if you have any ideas on how i could improve the tests please let me know :)At some point in future i'll do a PR to allow progress events in the Node world.