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%2FmergeScan.ts;h=c7348521914b9307bb8a17d32ee198d77096b3a4;hp=60ff2882f9479643edd3689c3028463a1c6e4b7e;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/mergeScan.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/mergeScan.ts index 60ff2882..c7348521 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/mergeScan.ts +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/mergeScan.ts @@ -2,10 +2,8 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; -import { subscribeToResult } from '../util/subscribeToResult'; -import { OuterSubscriber } from '../OuterSubscriber'; -import { InnerSubscriber } from '../InnerSubscriber'; import { ObservableInput, OperatorFunction } from '../types'; +import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe'; /** * Applies an accumulator function over the source Observable where the @@ -70,7 +68,7 @@ export class MergeScanOperator implements Operator { * @ignore * @extends {Ignored} */ -export class MergeScanSubscriber extends OuterSubscriber { +export class MergeScanSubscriber extends SimpleOuterSubscriber { private hasValue: boolean = false; private hasCompleted: boolean = false; private buffer: Observable[] = []; @@ -93,20 +91,20 @@ export class MergeScanSubscriber extends OuterSubscriber { const { accumulator } = this; ish = accumulator(this.acc, value, index); } catch (e) { - return destination.error(e); + return destination.error!(e); } this.active++; - this._innerSub(ish, value, index); + this._innerSub(ish); } else { this.buffer.push(value); } } - private _innerSub(ish: any, value: T, index: number): void { - const innerSubscriber = new InnerSubscriber(this, value, index); + private _innerSub(ish: any): void { + const innerSubscriber = new SimpleInnerSubscriber(this); const destination = this.destination as Subscription; destination.add(innerSubscriber); - const innerSubscription = subscribeToResult(this, ish, undefined, undefined, innerSubscriber); + const innerSubscription = innerSubscribe(ish, innerSubscriber); // The returned subscription will usually be the subscriber that was // passed. However, interop subscribers will be wrapped and for // unsubscriptions to chain correctly, the wrapper needs to be added, too. @@ -119,34 +117,30 @@ export class MergeScanSubscriber extends OuterSubscriber { this.hasCompleted = true; if (this.active === 0 && this.buffer.length === 0) { if (this.hasValue === false) { - this.destination.next(this.acc); + this.destination.next!(this.acc); } - this.destination.complete(); + this.destination.complete!(); } this.unsubscribe(); } - notifyNext(outerValue: T, innerValue: R, - outerIndex: number, innerIndex: number, - innerSub: InnerSubscriber): void { + notifyNext(innerValue: R): void { const { destination } = this; this.acc = innerValue; this.hasValue = true; - destination.next(innerValue); + destination.next!(innerValue); } - notifyComplete(innerSub: Subscription): void { + notifyComplete(): void { const buffer = this.buffer; - const destination = this.destination as Subscription; - destination.remove(innerSub); this.active--; if (buffer.length > 0) { this._next(buffer.shift()); } else if (this.active === 0 && this.hasCompleted) { if (this.hasValue === false) { - this.destination.next(this.acc); + this.destination.next!(this.acc); } - this.destination.complete(); + this.destination.complete!(); } } }