From 4ee5f024bf4b3b93fa0d4d35b99e2bdee5fad1c0 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 22 Jan 2016 15:59:33 +0900 Subject: [PATCH] fix(MergeMapSubscriber): clearfy type definitions for MergeMapSubscriber's members - `MergeMapSubscriber.buffer` should be `T[]` (`Array`) because it is given a source value `T`. - The type of 1st argument of `MergeMapSubscriber. innerSub` should be `Observable` because the result of `MergeMapSubscriber.project` will be passed to it. --- src/operator/mergeMap.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/operator/mergeMap.ts b/src/operator/mergeMap.ts index cfadfff36e..b5076f0ef4 100644 --- a/src/operator/mergeMap.ts +++ b/src/operator/mergeMap.ts @@ -39,7 +39,7 @@ export class MergeMapOperator implements Operator { export class MergeMapSubscriber extends OuterSubscriber { private hasCompleted: boolean = false; - private buffer: Observable[] = []; + private buffer: T[] = []; private active: number = 0; protected index: number = 0; @@ -50,7 +50,7 @@ export class MergeMapSubscriber extends OuterSubscriber { super(destination); } - protected _next(value: any): void { + protected _next(value: T): void { if (this.active < this.concurrent) { const index = this.index++; const ish = tryCatch(this.project)(value, index); @@ -66,7 +66,7 @@ export class MergeMapSubscriber extends OuterSubscriber { } } - private _innerSub(ish: any, value: T, index: number): void { + private _innerSub(ish: Observable, value: T, index: number): void { this.add(subscribeToResult(this, ish, value, index)); }