unfetch
unfetch copied to clipboard
🐕 Bare minimum 500b fetch polyfill.
Resolves #54 Alternative to #68, and #137 ### This solution - Supports single `abort()` for the several parallel fetch requests - Actually do http request abort over the network (not...
How it should be ```js let e = await fetch('https://i.imgur.com/4AiXzf8.jpg') // Response { type: "cors", url: "https://i.imgur.com/4AiXzf8.jpg", redirected: false, status: 200, ok: true, statusText: "OK", headers: // Headers, body: ReadableStream,...
https://developers.google.com/web/updates/2017/09/abortable-fetch Currently it is only implemented in Firefox 57 and is coming to other browsers soon. ```javascript const controller = new AbortController(); const signal = controller.signal; setTimeout(() => controller.abort(), 5000);...
It seems that the promise is not rejected with an error and it generates this warning:  Consider using something like: ``` request.onerror = function() { reject(new Error('Request for '...
Typescript does not support .mjs files, so the module that ends up being imported is the commonJS version (`dist/unfetch.js`). Since that file does not contain a `default` export entry, using...
After a chat in https://github.com/developit/unfetch/issues/96 I decided to remove the `node-fetch` imports from `unfetch` definition file as now it produces TS compiler errors. `isomorphic-unfetch` definion stayed untouched.
``` $ cat node_modules/isomorphic-unfetch/package.json | grep version "version": "3.0.0", ``` ``` $ tsc --noEmit --project . node_modules/isomorphic-unfetch/index.d.ts:2:3 - error TS2305: Module '"../../../../../../../Users/balupton/Projects/meet/bevry-meet/node_modules/node-fetch/lib"' has no exported member 'Body'. 2 Body as...
## steps to reproduce [email protected]: ```html fetch('page2.html') .then(function(response) { return response.text(); }) .then(function(data) { console.log(data); }); ... any data ... ``` use any http server that supports Access-Control-Allow-Origin headers: ```bash...
Resolves #54. Alternative solution to #68. My implementation differs in the following ways: - fetch does not override signal's abort handler (one controller can cancel many actions) - abort results...