Skip to content

Commit

Permalink
fix(typings): the return type of project of mergeScan should be Obser…
Browse files Browse the repository at this point in the history
…vableInput<R>
  • Loading branch information
Brooooooklyn committed Dec 25, 2017
1 parent c9f69ad commit 23fe17d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/operator/mergeScan.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Observable } from '../Observable';
import { Observable, ObservableInput } from '../Observable';
import { mergeScan as higherOrder } from '../operators/mergeScan';

/**
Expand Down Expand Up @@ -34,7 +34,7 @@ import { mergeScan as higherOrder } from '../operators/mergeScan';
* @owner Observable
*/
export function mergeScan<T, R>(this: Observable<T>,
accumulator: (acc: R, value: T) => Observable<R>,
accumulator: (acc: R, value: T) => ObservableInput<R>,
seed: R,
concurrent: number = Number.POSITIVE_INFINITY): Observable<R> {
return higherOrder(accumulator, seed, concurrent)(this);
Expand Down
8 changes: 4 additions & 4 deletions src/operators/mergeScan.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Operator } from '../Operator';
import { Observable } from '../Observable';
import { Observable, ObservableInput } from '../Observable';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { tryCatch } from '../util/tryCatch';
Expand Down Expand Up @@ -40,14 +40,14 @@ import { OperatorFunction } from '../interfaces';
* @method mergeScan
* @owner Observable
*/
export function mergeScan<T, R>(accumulator: (acc: R, value: T) => Observable<R>,
export function mergeScan<T, R>(accumulator: (acc: R, value: T) => ObservableInput<R>,
seed: R,
concurrent: number = Number.POSITIVE_INFINITY): OperatorFunction<T, R> {
return (source: Observable<T>) => source.lift(new MergeScanOperator(accumulator, seed, concurrent));
}

export class MergeScanOperator<T, R> implements Operator<T, R> {
constructor(private accumulator: (acc: R, value: T) => Observable<R>,
constructor(private accumulator: (acc: R, value: T) => ObservableInput<R>,
private seed: R,
private concurrent: number) {
}
Expand All @@ -72,7 +72,7 @@ export class MergeScanSubscriber<T, R> extends OuterSubscriber<T, R> {
protected index: number = 0;

constructor(destination: Subscriber<R>,
private accumulator: (acc: R, value: T) => Observable<R>,
private accumulator: (acc: R, value: T) => ObservableInput<R>,
private acc: R,
private concurrent: number) {
super(destination);
Expand Down

0 comments on commit 23fe17d

Please sign in to comment.