6 lines
969 B
JavaScript
6 lines
969 B
JavaScript
|
"use strict";
|
||
|
/**
|
||
|
* @license Angular v<unknown>
|
||
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
||
|
* License: MIT
|
||
|
*/Zone.__load_patch("fetch",((t,e,n)=>{let c=t.fetch;if("function"!=typeof c)return;const o=t[n.symbol("fetch")];o&&(c=o);const r=t.Promise,s=n.symbol("thenPatched"),l=n.symbol("fetchTaskScheduling"),a=function(){};t.fetch=function(){const t=Array.prototype.slice.call(arguments),o=t.length>1?t[1]:{},i=o&&o.signal,h=new AbortController;return o.signal=h.signal,t[1]=o,i&&(i[e.__symbol__("addEventListener")]||i.addEventListener).call(i,"abort",(function(){h.abort()}),{once:!0}),new Promise(((o,i)=>{const f=e.current.scheduleMacroTask("fetch",a,{fetchArgs:t},(()=>{let a,h=e.current;try{h[l]=!0,a=c.apply(this,t)}catch(t){return void i(t)}finally{h[l]=!1}if(!(a instanceof r)){let t=a.constructor;t[s]||n.patchThen(t)}a.then((t=>{"notScheduled"!==f.state&&f.invoke(),o(t)}),(t=>{"notScheduled"!==f.state&&f.invoke(),i(t)}))}),(()=>{h.abort()}))}))}}));
|