Skip to content

)}

ObservableBridgeExtensions.ToObservable(IObservableAsync) method

Defined in

Type: ObservableBridgeExtensions Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

public static IObservable<T> ToObservable<T>(this IObservableAsync<T> source)

View source

Summary: Converts an ObservableAsync sequence into a classic IObservable that can be consumed by System.Reactive operators and subscribers.

Type parameters

NameDescription
TThe type of elements in the observable sequence.

Parameters

NameTypeDescription
source[IObservableAsync](#The async observable sequence to bridge. Cannot be null.

Returns: IObservable -- An IObservable that mirrors the async observable sequence.

Remarks

The returned IObservable subscribes to the async observable on each Subscribe call. Async OnNext callbacks are awaited sequentially; the synchronous IObserver is notified on the thread that completes each await.

Disposing the IDisposable subscription returned by Subscribe disposes the underlying IAsyncDisposable async subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionThrown if source is null.