Observable.MostRecent(IObservable, TSource) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
public static IEnumerable<TSource> MostRecent<TSource>(this IObservable<TSource> source, TSource initialValue)
Summary: Returns an enumerable sequence whose enumeration returns the most recently observed element in the source observable sequence, using the specified initial value in case no element has been sampled yet. Enumerators on the resulting sequence never block and can produce the same element repeatedly.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source observable sequence. |
initialValue | TSource | Initial value that will be yielded by the enumerable sequence if no element has been sampled yet. |
Returns: IEnumerable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |