Skip to content

,System.Func)}

Observable.DoWhile(IObservable, Func) method

Defined in

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

Applies to

netstandard2.0

public static IObservable<TSource> DoWhile<TSource>(this IObservable<TSource> source, Func<bool> condition)

Summary: Repeats the given source as long as the specified condition holds, where the condition is evaluated after each repeated source completed.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource to repeat as long as the condition function evaluates to true.
conditionFuncCondition that will be evaluated upon the completion of an iteration through the source, to determine whether repetition of the source is required.

Returns: IObservable -- The observable sequence obtained by concatenating the source sequence as long as the condition holds.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or condition is null.