Skip to content

Commit

Permalink
Merge 0936dc6 into 0a6c4e8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetsuharu OHZEKI committed Jun 13, 2016
2 parents 0a6c4e8 + 0936dc6 commit 604800c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/operator/mergeMapTo.ts
@@ -1,4 +1,4 @@
import {Observable, ObservableInput, SubscribableOrPromise} from '../Observable';
import {Observable, ObservableInput} from '../Observable';
import {Operator} from '../Operator';
import {PartialObserver} from '../Observer';
import {Subscriber} from '../Subscriber';
Expand Down Expand Up @@ -70,7 +70,7 @@ export interface MergeMapToSignature<T> {
// TODO: Figure out correct signature here: an Operator<Observable<T>, R>
// needs to implement call(observer: Subscriber<R>): Subscriber<Observable<T>>
export class MergeMapToOperator<T, I, R> implements Operator<Observable<T>, R> {
constructor(private ish: SubscribableOrPromise<I>,
constructor(private ish: ObservableInput<I>,
private resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R,
private concurrent: number = Number.POSITIVE_INFINITY) {
}
Expand All @@ -87,18 +87,18 @@ export class MergeMapToOperator<T, I, R> implements Operator<Observable<T>, R> {
*/
export class MergeMapToSubscriber<T, I, R> extends OuterSubscriber<T, I> {
private hasCompleted: boolean = false;
private buffer: Observable<any>[] = [];
private buffer: T[] = [];
private active: number = 0;
protected index: number = 0;

constructor(destination: Subscriber<R>,
private ish: SubscribableOrPromise<I>,
private ish: ObservableInput<I>,
private resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R,
private concurrent: number = Number.POSITIVE_INFINITY) {
super(destination);
}

protected _next(value: any): void {
protected _next(value: T): void {
if (this.active < this.concurrent) {
const resultSelector = this.resultSelector;
const index = this.index++;
Expand All @@ -112,7 +112,7 @@ export class MergeMapToSubscriber<T, I, R> extends OuterSubscriber<T, I> {
}
}

private _innerSub(ish: any,
private _innerSub(ish: ObservableInput<I>,
destination: PartialObserver<I>,
resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R,
value: T,
Expand Down

0 comments on commit 604800c

Please sign in to comment.