Server IP : 150.95.80.236 / Your IP : 3.143.241.133 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/api-uat.pcu.in.th/node_modules/rxjs/dist/esm5/internal/observable/dom/ |
Upload File : |
import { __assign, __rest } from "tslib"; import { createOperatorSubscriber } from '../../operators/OperatorSubscriber'; import { Observable } from '../../Observable'; import { innerFrom } from '../../observable/innerFrom'; export function fromFetch(input, initWithSelector) { if (initWithSelector === void 0) { initWithSelector = {}; } var selector = initWithSelector.selector, init = __rest(initWithSelector, ["selector"]); return new Observable(function (subscriber) { var controller = new AbortController(); var signal = controller.signal; var abortable = true; var outerSignal = init.signal; if (outerSignal) { if (outerSignal.aborted) { controller.abort(); } else { var outerSignalHandler_1 = function () { if (!signal.aborted) { controller.abort(); } }; outerSignal.addEventListener('abort', outerSignalHandler_1); subscriber.add(function () { return outerSignal.removeEventListener('abort', outerSignalHandler_1); }); } } var perSubscriberInit = __assign(__assign({}, init), { signal: signal }); var handleError = function (err) { abortable = false; subscriber.error(err); }; fetch(input, perSubscriberInit) .then(function (response) { if (selector) { innerFrom(selector(response)).subscribe(createOperatorSubscriber(subscriber, undefined, function () { abortable = false; subscriber.complete(); }, handleError)); } else { abortable = false; subscriber.next(response); subscriber.complete(); } }) .catch(handleError); return function () { if (abortable) { controller.abort(); } }; }); } //# sourceMappingURL=fetch.js.map