From f5f018054164e5c8944c7293f5fb4c651299dacc Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Sat, 11 Jun 2016 01:57:50 +0900 Subject: [PATCH] refactor(switchMap): clarify 'any' types which are used in SwitchMapSubscriber (#1751) * refactor(switchMap): make SwitchMapSubscriber._tryNotifyNext() private * refactor(switchMap): clarify 'any' types which are used in SwitchMapSubscriber --- src/operator/switchMap.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/operator/switchMap.ts b/src/operator/switchMap.ts index 7e7d78b85c..ca71afe1b3 100644 --- a/src/operator/switchMap.ts +++ b/src/operator/switchMap.ts @@ -90,7 +90,7 @@ class SwitchMapSubscriber extends OuterSubscriber { } protected _next(value: T) { - let result: any; + let result: ObservableInput; const index = this.index++; try { result = this.project(value, index); @@ -101,7 +101,7 @@ class SwitchMapSubscriber extends OuterSubscriber { this._innerSub(result, value, index); } - private _innerSub(result: any, value: T, index: number) { + private _innerSub(result: ObservableInput, value: T, index: number) { const innerSubscription = this.innerSubscription; if (innerSubscription) { innerSubscription.unsubscribe(); @@ -138,8 +138,8 @@ class SwitchMapSubscriber extends OuterSubscriber { } } - _tryNotifyNext(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): void { - let result: any; + private _tryNotifyNext(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): void { + let result: R; try { result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex); } catch (err) {