-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(expand): accept scheduler parameter
Also moves the handling of the default value for optional parameters to the expand function instead of the operator's ctor. Closes #841.
- Loading branch information
1 parent
ef83066
commit 79e9084
Showing
5 changed files
with
57 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import {Observable} from '../Observable'; | ||
import {Scheduler} from '../Scheduler'; | ||
import {ExpandOperator} from './expand-support'; | ||
|
||
export function expand<T, R>(project: (value: T, index: number) => Observable<R>, | ||
concurrent: number = Number.POSITIVE_INFINITY): Observable<R> { | ||
return this.lift(new ExpandOperator(project, concurrent)); | ||
concurrent: number = Number.POSITIVE_INFINITY, | ||
scheduler: Scheduler = undefined): Observable<R> { | ||
concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; | ||
|
||
return this.lift(new ExpandOperator(project, concurrent, scheduler)); | ||
} |