,System.IObservable{--0>
Defined in Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
public static IObservable<TSource> While<TSource>(Func<bool> condition, IObservable<TSource> source)
Summary:
Repeats the given source as long as the specified condition holds, where the condition is evaluated before each repeated source is subscribed to.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
condition | Func | Condition that will be evaluated before subscription to the source, to determine whether repetition of the source is required. |
source | IObservable | Source to repeat as long as the condition function evaluates to true. |
Returns: IObservablesource sequence as long as the condition holds.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or source is null. |