Skip to content

)} ,--0)}

ObservableAsync.StatelessPublish(IObservableAsync) method

Defined in

Type: ObservableAsync 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

Overloads

  • 1. public static ConnectableObservableAsync<T> StatelessPublish<T>(this IObservableAsync<T> source)
  • 2. public static ConnectableObservableAsync<T> StatelessPublish<T>(this IObservableAsync<T> source, T initialValue)

1. Overload

public static ConnectableObservableAsync<T> StatelessPublish<T>(this IObservableAsync<T> source)

View source

Summary: Creates a connectable observable sequence that shares a single subscription to the underlying source and does not retain any state between subscriptions.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IObservableAsync](#The source sequence.

Returns: ConnectableObservableAsync -- A connectable observable sequence that multicasts notifications from the source without retaining state between subscribers.

Remarks

Use this method when you want to share a single subscription to the source among multiple observers, but do not require the observable to cache or replay any items for new subscribers. Each connection to the returned observable is independent and does not affect subsequent connections.

2. Overload

public static ConnectableObservableAsync<T> StatelessPublish<T>(this IObservableAsync<T> source, T initialValue)

View source

Summary: Creates a connectable observable sequence that shares a single subscription to the underlying source and replays the most recent value to new subscribers, starting with the specified initial value.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IObservableAsync](#The source sequence.
initialValueTThe initial value to be emitted to subscribers before any values are published by the source sequence.

Returns: ConnectableObservableAsync -- A connectable observable sequence that multicasts the source sequence and replays the latest value, starting with the specified initial value.

Remarks

The returned observable does not maintain any state between connections. Each connection starts with the provided initial value and only replays the most recent value published during that connection. This is useful for scenarios where late subscribers should always receive the latest value, even if they subscribe after the source has started emitting.