It returns a Promise that resolves to the Response to that request — as soon as the server responds with headers — even if the server response is an HTTP error status.
At the heart of Fetch are the Interface abstractions of HTTP Requests, Responses, and Headers, along with a fetch() method for initiating asynchronous resource requests
In other words, it should fire the 'abort' event and cancels the request and DO NOT throw an error. Because fetch is asynchronous*
fetch is asynchronous, based on Promise, but resolved only when response is received.
Whats the difference between Ponyfill and Polyfill?
Polyfill - checks if functionality is not available and add it:
Ponyfill - just the adds own same functionality:
What about whatwg-fetch on this project?
whatwg-fetch is Polyfill, but on acts like Ponyfill. Why?
This will cause some unexpected behaviour of the fetch function.
For example, it throws an Error when request is aborted. Should it?
Abort should not throw the error:
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
In other words, it should fire the 'abort' event and cancels the request and DO NOT throw an error. Because fetch is asynchronous* fetch is asynchronous, based on Promise, but resolved only when response is received.