Class MergeMapOperator
Extension methods implementing the mergeMap operator.
public static class MergeMapOperator
- Inheritance
-
System.ObjectMergeMapOperator
Remarks
Unlike rxjs's mergeMap(project, concurrent), this port always merges with unbounded concurrency:
there is no concurrent limit parameter, since Puppeteer's own usage (the motivating consumer of
this port) never needs to cap in-flight inner subscriptions.
Methods
MergeMap<TSource, TResult>(Observable<TSource>, Func<TSource, Observable<TResult>>)
Projects each value from source to an inner observable via project,
subscribes to every inner observable as soon as it is produced, and merges all of their emissions into
the output. The output completes once source has completed and every inner
observable it produced has also completed.
public static Observable<TResult> MergeMap<TSource, TResult>(this Observable<TSource> source, Func<TSource, Observable<TResult>> project)
Parameters
sourceObservable<TSource>The source sequence.
projectFunc<TSource, Observable<TResult>>A function that maps each source value to an inner observable to merge into the output.
Returns
- Observable<TResult>
An observable that merges the values of all inner observables produced from the source values.
Type Parameters
TSourceThe type of values emitted by
source.TResultThe type of values emitted by the inner observables produced by
project.
Remarks
If project throws, the exception is forwarded to the subscriber via OnError
instead of propagating synchronously. An error from source or from any inner
observable also terminates the output immediately via OnError.
MergeMap<TSource, TResult>(Observable<TSource>, Func<TSource, int, Observable<TResult>>)
Projects each value from source, along with its zero-based index, to an inner
observable via project, subscribes to every inner observable as soon as it is
produced, and merges all of their emissions into the output. The output completes once
source has completed and every inner observable it produced has also completed.
public static Observable<TResult> MergeMap<TSource, TResult>(this Observable<TSource> source, Func<TSource, int, Observable<TResult>> project)
Parameters
sourceObservable<TSource>The source sequence.
projectFunc<TSource, int, Observable<TResult>>A function that maps each source value and its index (starting at 0) to an inner observable to merge into the output.
Returns
- Observable<TResult>
An observable that merges the values of all inner observables produced from the source values.
Type Parameters
TSourceThe type of values emitted by
source.TResultThe type of values emitted by the inner observables produced by
project.
Remarks
If project throws, the exception is forwarded to the subscriber via OnError
instead of propagating synchronously. An error from source or from any inner
observable also terminates the output immediately via OnError.