1 line
No EOL
6 KiB
JSON
1 line
No EOL
6 KiB
JSON
{"ast":null,"code":"import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport function throttle(durationSelector, config) {\n return operate(function (source, subscriber) {\n var _a = config !== null && config !== void 0 ? config : {},\n _b = _a.leading,\n leading = _b === void 0 ? true : _b,\n _c = _a.trailing,\n trailing = _c === void 0 ? false : _c;\n var hasValue = false;\n var sendValue = null;\n var throttled = null;\n var isComplete = false;\n var endThrottling = function () {\n throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();\n throttled = null;\n if (trailing) {\n send();\n isComplete && subscriber.complete();\n }\n };\n var cleanupThrottling = function () {\n throttled = null;\n isComplete && subscriber.complete();\n };\n var startThrottle = function (value) {\n return throttled = innerFrom(durationSelector(value)).subscribe(createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling));\n };\n var send = function () {\n if (hasValue) {\n hasValue = false;\n var value = sendValue;\n sendValue = null;\n subscriber.next(value);\n !isComplete && startThrottle(value);\n }\n };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n hasValue = true;\n sendValue = value;\n !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));\n }, function () {\n isComplete = true;\n !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=throttle.js.map","map":{"version":3,"names":["operate","createOperatorSubscriber","innerFrom","throttle","durationSelector","config","source","subscriber","_a","_b","leading","_c","trailing","hasValue","sendValue","throttled","isComplete","endThrottling","unsubscribe","send","complete","cleanupThrottling","startThrottle","value","subscribe","next","closed"],"sources":["/home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/implem/node_modules/rxjs/dist/esm5/internal/operators/throttle.js"],"sourcesContent":["import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport function throttle(durationSelector, config) {\n return operate(function (source, subscriber) {\n var _a = config !== null && config !== void 0 ? config : {}, _b = _a.leading, leading = _b === void 0 ? true : _b, _c = _a.trailing, trailing = _c === void 0 ? false : _c;\n var hasValue = false;\n var sendValue = null;\n var throttled = null;\n var isComplete = false;\n var endThrottling = function () {\n throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();\n throttled = null;\n if (trailing) {\n send();\n isComplete && subscriber.complete();\n }\n };\n var cleanupThrottling = function () {\n throttled = null;\n isComplete && subscriber.complete();\n };\n var startThrottle = function (value) {\n return (throttled = innerFrom(durationSelector(value)).subscribe(createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling)));\n };\n var send = function () {\n if (hasValue) {\n hasValue = false;\n var value = sendValue;\n sendValue = null;\n subscriber.next(value);\n !isComplete && startThrottle(value);\n }\n };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n hasValue = true;\n sendValue = value;\n !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));\n }, function () {\n isComplete = true;\n !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=throttle.js.map"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,wBAAwB,QAAQ,sBAAsB;AAC/D,SAASC,SAAS,QAAQ,yBAAyB;AACnD,OAAO,SAASC,QAAQA,CAACC,gBAAgB,EAAEC,MAAM,EAAE;EAC/C,OAAOL,OAAO,CAAC,UAAUM,MAAM,EAAEC,UAAU,EAAE;IACzC,IAAIC,EAAE,GAAGH,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAK,KAAK,CAAC,GAAGA,MAAM,GAAG,CAAC,CAAC;MAAEI,EAAE,GAAGD,EAAE,CAACE,OAAO;MAAEA,OAAO,GAAGD,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,GAAGA,EAAE;MAAEE,EAAE,GAAGH,EAAE,CAACI,QAAQ;MAAEA,QAAQ,GAAGD,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,GAAGA,E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