I'm a web developer, graphic designer, type designer, musician, comicbook-geek, LEGO-collector, food lover … as well as husband and father, located just south of Copenhagen, Denmark.
I think it's just an easier syntax, parsing one init-object with these extra options. The result itself is a Promise, the start/stop callback is called on init, and in the .finally()-block. The errorHandler takes care of "AbortErrors" (timeout) as well:
catch(error=>{if(error.name==='AbortError'){errorHandler({name:'FetchError',message:`Timeout after ${timeout} milliseconds.`,response:'',status:524});}else{errorHandler(error);}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think it's just an easier syntax, parsing one init-object with these extra options. The result itself is a Promise, the start/stop callback is called on init, and in the
.finally()
-block. The errorHandler takes care of "AbortErrors" (timeout) as well: