Skip to content

,System.Func{--0,System.IObservable{--0}},System.Reactive.Concurrency.IScheduler)} ,System.Func{--0,System.IObservable{--0}})}

ObservableEx.Expand(IObservable, Func>, IScheduler) method

Defined in

Type: ObservableEx Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector, IScheduler scheduler)
  • 2. public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector)

1. Overload

Attributes: [Experimental]

public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector, IScheduler scheduler)

Summary: Expands an observable sequence by recursively invoking selector, using the specified scheduler to enumerate the queue of obtained sequences.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence and each of the recursively expanded sources obtained by running the selector function.

Parameters

NameTypeDescription
sourceIObservableSource sequence with the initial elements.
selectorFunc>Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
scheduler[IScheduler](#Scheduler on which to perform the expansion by enumerating the internal queue of obtained sequences.

Returns: IObservable -- An observable sequence containing all the elements produced by the recursive expansion.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector or scheduler is null.

2. Overload

Attributes: [Experimental]

public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector)

Summary: Expands an observable sequence by recursively invoking selector.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence and each of the recursively expanded sources obtained by running the selector function.

Parameters

NameTypeDescription
sourceIObservableSource sequence with the initial elements.
selectorFunc>Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.

Returns: IObservable -- An observable sequence containing all the elements produced by the recursive expansion.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.