mo / abortcontroller-polyfill

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

this lib working in ie 11? #25

Closed juuuuuuuuuuuuuu closed 5 years ago

juuuuuuuuuuuuuu commented 5 years ago

i use this library. but ie is not working. is not support ie??

mo commented 5 years ago

Yes, but for this browser you need to first install a polyfill for ES6 promises, then a polyfill for fetch() itself, and finally you import the abortcontroller-polyfill. I.e. install

npm install --save promise-polyfill unfetch abortcontroller-polyfill

And then do the imports in this order:

import 'promise-polyfill/src/polyfill';
import 'unfetch/polyfill';
import 'abortcontroller-polyfill';

There are example code available here (both React-based and vanilla Javascript): https://github.com/mo/abortcontroller-polyfill-examples/tree/master/create-react-app-msie11