Skip to content

Commit 4ee5f02

Browse files
fix(MergeMapSubscriber): clearfy type definitions for MergeMapSubscriber'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.
1 parent b727355 commit 4ee5f02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/operator/mergeMap.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class MergeMapOperator<T, R, R2> implements Operator<T, R> {
3939

4040
export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
4141
private hasCompleted: boolean = false;
42-
private buffer: Observable<any>[] = [];
42+
private buffer: T[] = [];
4343
private active: number = 0;
4444
protected index: number = 0;
4545

@@ -50,7 +50,7 @@ export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
5050
super(destination);
5151
}
5252

53-
protected _next(value: any): void {
53+
protected _next(value: T): void {
5454
if (this.active < this.concurrent) {
5555
const index = this.index++;
5656
const ish = tryCatch(this.project)(value, index);
@@ -66,7 +66,7 @@ export class MergeMapSubscriber<T, R, R2> extends OuterSubscriber<T, R> {
6666
}
6767
}
6868

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

0 commit comments

Comments
 (0)