X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2Fsrc%2Finternal%2Foperators%2Fdebounce.ts;h=78fad34c68eb1335fcf065feb7cbcc12c571f29b;hp=be2167d9bfb1e48e2d490c221b6f25334931cfa4;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/debounce.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/debounce.ts index be2167d9..78fad34c 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/debounce.ts +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/debounce.ts @@ -3,10 +3,7 @@ import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; import { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types'; - -import { OuterSubscriber } from '../OuterSubscriber'; -import { InnerSubscriber } from '../InnerSubscriber'; -import { subscribeToResult } from '../util/subscribeToResult'; +import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe'; /** * Emits a value from the source Observable only after a particular time span @@ -74,10 +71,10 @@ class DebounceOperator implements Operator { * @ignore * @extends {Ignored} */ -class DebounceSubscriber extends OuterSubscriber { - private value: T; - private hasValue: boolean = false; - private durationSubscription: Subscription = null; +class DebounceSubscriber extends SimpleOuterSubscriber { + private value?: T; + private hasValue = false; + private durationSubscription?: Subscription; constructor(destination: Subscriber, private durationSelector: (value: T) => SubscribableOrPromise) { @@ -92,13 +89,13 @@ class DebounceSubscriber extends OuterSubscriber { this._tryNext(value, result); } } catch (err) { - this.destination.error(err); + this.destination.error!(err); } } protected _complete(): void { this.emitValue(); - this.destination.complete(); + this.destination.complete!(); } private _tryNext(value: T, duration: SubscribableOrPromise): void { @@ -110,15 +107,13 @@ class DebounceSubscriber extends OuterSubscriber { this.remove(subscription); } - subscription = subscribeToResult(this, duration); + subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this)); if (subscription && !subscription.closed) { this.add(this.durationSubscription = subscription); } } - notifyNext(outerValue: T, innerValue: R, - outerIndex: number, innerIndex: number, - innerSub: InnerSubscriber): void { + notifyNext(): void { this.emitValue(); } @@ -131,7 +126,7 @@ class DebounceSubscriber extends OuterSubscriber { const value = this.value; const subscription = this.durationSubscription; if (subscription) { - this.durationSubscription = null; + this.durationSubscription = undefined; subscription.unsubscribe(); this.remove(subscription); } @@ -140,9 +135,9 @@ class DebounceSubscriber extends OuterSubscriber { // the value to synchronously re-enter this operator // recursively if the duration selector Observable // emits synchronously - this.value = null; + this.value = undefined; this.hasValue = false; - super._next(value); + super._next(value!); } } }