mo / abortcontroller-polyfill

Polyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).
MIT License
326 stars 23 forks source link

feat: Implement `AbortController.prototype.abort(reason)` #65

Closed eps1lon closed 1 year ago

eps1lon commented 1 year ago

Previously the reason given in abort was ignored.

This PR forwards the reason to signal.reason and provides the fallbacks like Chrome and Node does

mo commented 1 year ago

I had to add one additional hack to make it run on MSIE 11 since DOMException constructor is not available there

However, your PR is merged to master now and released as 1.7.4 ... thanks for sending this patch!

eps1lon commented 1 year ago

I had to add one additional hack to make it run on MSIE 11 since DOMException constructor is not available there

Good call. I already forgot about this "browser" 😆

merged in https://github.com/mo/abortcontroller-polyfill/commit/8eb3ee51a20700fa766cd9138fa7d7ba64fa9277 DOMException fix in https://github.com/mo/abortcontroller-polyfill/commit/10e00a99a4bc0e726b0eb8935452a2ed19194d29