X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2F_esm2015%2Finternal%2Foperators%2Faudit.js;fp=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2F_esm2015%2Finternal%2Foperators%2Faudit.js;h=80618bf4cb0deb8dda14dd33250c44de080b3437;hb=3aba54c891969552833dbc350b3139e944e17a97;hp=0000000000000000000000000000000000000000;hpb=1def8ecce8e6f3aa32e6978d0ba7846a99b8de34;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/audit.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/audit.js new file mode 100644 index 00000000..80618bf4 --- /dev/null +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/audit.js @@ -0,0 +1,63 @@ +import { OuterSubscriber } from '../OuterSubscriber'; +import { subscribeToResult } from '../util/subscribeToResult'; +export function audit(durationSelector) { + return function auditOperatorFunction(source) { + return source.lift(new AuditOperator(durationSelector)); + }; +} +class AuditOperator { + constructor(durationSelector) { + this.durationSelector = durationSelector; + } + call(subscriber, source) { + return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector)); + } +} +class AuditSubscriber extends OuterSubscriber { + constructor(destination, durationSelector) { + super(destination); + this.durationSelector = durationSelector; + this.hasValue = false; + } + _next(value) { + this.value = value; + this.hasValue = true; + if (!this.throttled) { + let duration; + try { + const { durationSelector } = this; + duration = durationSelector(value); + } + catch (err) { + return this.destination.error(err); + } + const innerSubscription = subscribeToResult(this, duration); + if (!innerSubscription || innerSubscription.closed) { + this.clearThrottle(); + } + else { + this.add(this.throttled = innerSubscription); + } + } + } + clearThrottle() { + const { value, hasValue, throttled } = this; + if (throttled) { + this.remove(throttled); + this.throttled = null; + throttled.unsubscribe(); + } + if (hasValue) { + this.value = null; + this.hasValue = false; + this.destination.next(value); + } + } + notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.clearThrottle(); + } + notifyComplete() { + this.clearThrottle(); + } +} +//# sourceMappingURL=audit.js.map \ No newline at end of file