ObservableExtensions.

ConcatMap<TSource, TCollection, TResult>(IObservable<TSource>, Func<TSource, IObservable<TCollection>>, Func<TSource, TCollection, TResult>) Method

Summary

Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.

Syntax

public static IObservable<TResult> ConcatMap<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)

Type Parameters

Name Description
TSource The type of the elements in the source sequence.
TCollection The type of the elements in the projected intermediate sequences.
TResult The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.

Parameters

Name Type Description
source IObservable<TSource> An observable sequence of elements to project.
collectionSelector Func<TSource, IObservable<TCollection>> A transform function to apply to each element.
resultSelector Func<TSource, TCollection, TResult> A transform function to apply to each element of the intermediate sequence.

Return Value

Type Description
IObservable<TResult> An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.