Skip to content

Signal.CreateReplayLatest() method

Defined in

Type: Signal Namespace: ReactiveUI.Primitives.Async.Signals Assembly: ReactiveUI.Primitives.Async.Core.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, net471

Overloads

  • 1. public static ISignalAsync<T> CreateReplayLatest<T>()
  • 2. public static ISignalAsync<T> CreateReplayLatest<T>(ReplayLatestSignalCreationOptions? options)

1. Overload

public static ISignalAsync<T> CreateReplayLatest<T>()

View source

Summary: Creates a new asynchronous Signal that replays only the most recent value to new subscribers.

Type parameters

NameDescription
TThe type of the elements processed by the Signal.

Returns: ISignalAsync -- An asynchronous Signal that stores and replays the latest value to each new subscriber.

Remarks

The returned Signal will only retain the most recent value published. When a new subscriber subscribes, it immediately receives the latest value, if any, followed by subsequent values. This is useful for scenarios where only the most recent state is relevant to new observers.

2. Overload

public static ISignalAsync<T> CreateReplayLatest<T>(ReplayLatestSignalCreationOptions? options)

View source

Summary: Creates a new asynchronous Signal that replays the latest value to new subscribers, with configuration options for publishing behavior and statefulness.

Type parameters

NameDescription
TThe type of the elements processed by the Signal.

Parameters

NameTypeDescription
options[ReplayLatestSignalCreationOptions?](#The options that specify the publishing mode and whether the Signal maintains state. Cannot be null.

Returns: ISignalAsync -- An asynchronous Signal that replays the latest value to new subscribers, configured according to the specified options.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if the combination of options specified in the options parameter is not supported.