Skip to content

Commit

Permalink
fix(MergeMapSubscriber): clearfy type definitions for MergeMapSubscri…
Browse files Browse the repository at this point in the history
…ber's members

- `MergeMapSubscriber.buffer` should be `T[]` (`Array<T>`)
  because it is given a source value `T`.

- The type of 1st argument of `MergeMapSubscriber.
  innerSub` should be `Observable<R>` because the result of
  `MergeMapSubscriber.project` will be passed to it.
  • Loading branch information
tetsuharuohzeki committed Jan 26, 2016
1 parent b727355 commit 4ee5f02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operator/mergeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class MergeMapOperator<T, R, R2> implements Operator<T, R> {

export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
private hasCompleted: boolean = false;
private buffer: Observable<any>[] = [];
private buffer: T[] = [];
private active: number = 0;
protected index: number = 0;

Expand All @@ -50,7 +50,7 @@ export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
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);
Expand All @@ -66,7 +66,7 @@ export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
}
}

private _innerSub(ish: any, value: T, index: number): void {
private _innerSub(ish: Observable<R>, value: T, index: number): void {
this.add(subscribeToResult<T, R>(this, ish, value, index));
}

Expand Down

0 comments on commit 4ee5f02

Please sign in to comment.