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%2Fexpand.ts;h=2047a780787758d53ef6be4a286393fe7e55308b;hp=b686d615733013db80d5367788ea986b7450f72e;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/expand.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/expand.ts index b686d615..2047a780 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/expand.ts +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/operators/expand.ts @@ -2,10 +2,8 @@ import { Observable } from '../Observable'; import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; -import { OuterSubscriber } from '../OuterSubscriber'; -import { InnerSubscriber } from '../InnerSubscriber'; -import { subscribeToResult } from '../util/subscribeToResult'; import { MonoTypeOperatorFunction, OperatorFunction, ObservableInput, SchedulerLike } from '../types'; +import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe'; /* tslint:disable:max-line-length */ export function expand(project: (value: T, index: number) => ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction; @@ -66,7 +64,7 @@ export function expand(project: (value: T, index: number) => ObservableInput< */ export function expand(project: (value: T, index: number) => ObservableInput, concurrent: number = Number.POSITIVE_INFINITY, - scheduler: SchedulerLike = undefined): OperatorFunction { + scheduler?: SchedulerLike): OperatorFunction { concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; return (source: Observable) => source.lift(new ExpandOperator(project, concurrent, scheduler)); @@ -75,7 +73,7 @@ export function expand(project: (value: T, index: number) => ObservableInp export class ExpandOperator implements Operator { constructor(private project: (value: T, index: number) => ObservableInput, private concurrent: number, - private scheduler: SchedulerLike) { + private scheduler?: SchedulerLike) { } call(subscriber: Subscriber, source: any): any { @@ -95,16 +93,16 @@ interface DispatchArg { * @ignore * @extends {Ignored} */ -export class ExpandSubscriber extends OuterSubscriber { +export class ExpandSubscriber extends SimpleOuterSubscriber { private index: number = 0; private active: number = 0; private hasCompleted: boolean = false; - private buffer: any[]; + private buffer?: any[]; constructor(destination: Subscriber, private project: (value: T, index: number) => ObservableInput, private concurrent: number, - private scheduler: SchedulerLike) { + private scheduler?: SchedulerLike) { super(destination); if (concurrent < Number.POSITIVE_INFINITY) { this.buffer = []; @@ -126,7 +124,7 @@ export class ExpandSubscriber extends OuterSubscriber { const index = this.index++; if (this.active < this.concurrent) { - destination.next(value); + destination.next!(value); try { const { project } = this; const result = project(value, index); @@ -135,46 +133,42 @@ export class ExpandSubscriber extends OuterSubscriber { } else { const state: DispatchArg = { subscriber: this, result, value, index }; const destination = this.destination as Subscription; - destination.add(this.scheduler.schedule>(ExpandSubscriber.dispatch, 0, state)); + destination.add(this.scheduler.schedule>(ExpandSubscriber.dispatch as any, 0, state)); } } catch (e) { - destination.error(e); + destination.error!(e); } } else { - this.buffer.push(value); + this.buffer!.push(value); } } private subscribeToProjection(result: any, value: T, index: number): void { this.active++; const destination = this.destination as Subscription; - destination.add(subscribeToResult(this, result, value, index)); + destination.add(innerSubscribe(result, new SimpleInnerSubscriber(this))); } protected _complete(): void { this.hasCompleted = true; if (this.hasCompleted && this.active === 0) { - this.destination.complete(); + this.destination.complete!(); } this.unsubscribe(); } - notifyNext(outerValue: T, innerValue: R, - outerIndex: number, innerIndex: number, - innerSub: InnerSubscriber): void { + notifyNext(innerValue: R): void { this._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 && buffer.length > 0) { this._next(buffer.shift()); } if (this.hasCompleted && this.active === 0) { - this.destination.complete(); + this.destination.complete!(); } } }