4 ms·
Fetch requests do support cancelation for a while now through `AbortController`. See: https://developers.google.com/web/updates/2017/09/abortable-fetch https://
by mhagemeister 9y ago
Fetch requests do support cancelation for a while now through `AbortController`. See: https://developers.google.com/web/updates/2017/09/abortable-fetch https://developers.google.com/web/updates/2017/09/abortable-...
- igvadaimon 9y agoWhich doesn't work even in Chrome.
- suprfsat 9y ago> await (()=>{ controller=new AbortController; req=new Request('https://httpbin.org/delay/10',{signal:controller.signal}); f=fetch(req); controller.abort(); return f;})() Uncaught (in promise) DOMException: The user aborted a request. (index):1 Uncaught (in promise) DOMException: The user aborted a request. VM80:1 Fetch failed loading: GET "https://httpbin.org/delay/10". > navigator.userAgent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.45 Safari/537.36"