SubjectAsync.CreateBehavior(T) method¶
Defined in
Type: SubjectAsync
Namespace: ReactiveUI.Extensions.Async.Subjects
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 ISubjectAsync<T> CreateBehavior<T>(T startValue) - 2.
public static ISubjectAsync<T> CreateBehavior<T>(T startValue, BehaviorSubjectCreationOptions? options)
1. Overload¶
public static ISubjectAsync<T> CreateBehavior<T>(T startValue)
Summary: Creates a new asynchronous behavior subject initialized with the specified starting value.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements processed by the subject. |
Parameters
| Name | Type | Description |
|---|---|---|
startValue | T | The initial value to be emitted to new subscribers and stored as the current value of the subject. |
Returns: ISubjectAsync
2. Overload¶
public static ISubjectAsync<T> CreateBehavior<T>(T startValue, BehaviorSubjectCreationOptions? options)
Summary: Creates a new asynchronous subject that replays the latest value to new subscribers, using the specified initial value and creation options.
Type parameters
| Name | Description |
|---|---|
T | The type of the values published by the subject. |
Parameters
| Name | Type | Description |
|---|---|---|
startValue | T | The initial value to be published by the subject before any values are pushed. |
options | [BehaviorSubjectCreationOptions?](# | The options that control the subject's publishing behavior and state management. |
Returns: ISubjectAsync
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown if the specified options contain an unsupported publishing configuration. |