Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typings): the return type of project of mergeScan should be ObservableInput<R> #3197

Merged
merged 1 commit into from
Dec 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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