Skip to content

Signal.CreateBehavior(T) 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> CreateBehavior<T>(T startValue)
  • 2. public static ISignalAsync<T> CreateBehavior<T>(T startValue, BehaviorSignalCreationOptions? options)

1. Overload

public static ISignalAsync<T> CreateBehavior<T>(T startValue)

View source

Summary: Creates a new asynchronous behavior Signal initialized with the specified starting value.

Type parameters

NameDescription
TThe type of the elements processed by the Signal.

Parameters

NameTypeDescription
startValueTThe initial value to be emitted to new subscribers and stored as the current value of the Signal.

Returns: ISignalAsync -- An asynchronous behavior Signal that holds the specified starting value and emits it to new subscribers.

2. Overload

public static ISignalAsync<T> CreateBehavior<T>(T startValue, BehaviorSignalCreationOptions? options)

View source

Summary: Creates a new asynchronous Signal that replays the latest value to new subscribers, using the specified initial value and creation options.

Type parameters

NameDescription
TThe type of the values published by the Signal.

Parameters

NameTypeDescription
startValueTThe initial value to be published by the Signal before any values are pushed.
options[BehaviorSignalCreationOptions?](#The options that control the Signal's publishing behavior and state management.

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 specified options contain an unsupported publishing configuration.