ng-implementation/implem/.angular/cache/20.1.4/babel-webpack/8514e146eabf1b511321e3a862b38207.json

1 line
8.9 KiB
JSON
Raw Normal View History

2025-08-19 10:58:54 +02:00
{"ast":null,"code":"import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport var TimeoutError = createErrorClass(function (_super) {\n return function TimeoutErrorImpl(info) {\n if (info === void 0) {\n info = null;\n }\n _super(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n };\n});\nexport function timeout(config, schedulerArg) {\n var _a = isValidDate(config) ? {\n first: config\n } : typeof config === 'number' ? {\n each: config\n } : config,\n first = _a.first,\n each = _a.each,\n _b = _a.with,\n _with = _b === void 0 ? timeoutErrorFactory : _b,\n _c = _a.scheduler,\n scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler : _c,\n _d = _a.meta,\n meta = _d === void 0 ? null : _d;\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n return operate(function (source, subscriber) {\n var originalSourceSubscription;\n var timerSubscription;\n var lastValue = null;\n var seen = 0;\n var startTimer = function (delay) {\n timerSubscription = executeSchedule(subscriber, scheduler, function () {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta: meta,\n lastValue: lastValue,\n seen: seen\n })).subscribe(subscriber);\n } catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next(lastValue = value);\n each > 0 && startTimer(each);\n }, undefined, undefined, function () {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n lastValue = null;\n }));\n !seen && startTimer(first != null ? typeof first === 'number' ? first : +first - scheduler.now() : each);\n });\n}\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}\n//# sourceMappingURL=timeout.js.map","map":{"version":3,"names":["asyncScheduler","isValidDate","operate","innerFrom","createErrorClass","createOperatorSubscriber","executeSchedule","TimeoutError","_super","TimeoutErrorImpl","info","message","name","timeout","config","schedulerArg","_a","first","each","_b","with","_with","timeoutErrorFactory","_c","scheduler","_d","meta","TypeError","source","subscriber","originalSourceSubscription","timerSubscription","lastValue","seen","startTimer","delay","unsubscribe","subscribe","err","error","value","next","undefined","closed","now"],"sources":["/home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/implem/node_modules/rxjs/dist/esm5/internal/operators/timeout.js"],"sourcesContent":["import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport var TimeoutError = createErrorClass(function (_super) {\n return function TimeoutErrorImpl(info) {\n if (info === void 0) { info = null; }\n _super(this);\n this.message = 'Timeout has occurred';\n this.na