,System.Action{--0})} ,System.Action{--0},System.Action{System.Exception},System.Action)} ,System.Action{--0},System.Action{System.Exception},System.Action,System.Boolean)}
ReactiveComponentBase.Observe(IObservable, Action) method¶
Defined in
Type: ReactiveComponentBase
Namespace: ReactiveUI.Primitives.Blazor.Reactive.Components
Assembly: ReactiveUI.Primitives.Blazor.Reactive.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
Overloads¶
- 1.
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext) - 2.
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted) - 3.
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted, bool refreshAfterCallbacks)
1. Overload¶
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext)
Summary: Subscribes to a source and refreshes the component after each value.
Type parameters
| Name | Description |
|---|---|
T | The source value type. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The source sequence. |
onNext | Action | Action invoked for each value on the Blazor renderer dispatcher. |
Returns: IDisposable -- A tracked subscription.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext is null. |
2. Overload¶
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted)
Summary: Subscribes to a source and refreshes the component after each observed signal.
Type parameters
| Name | Description |
|---|---|
T | The source value type. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The source sequence. |
onNext | Action | Action invoked for each value on the Blazor renderer dispatcher. |
onError | Action | Optional action invoked when the source errors. |
onCompleted | Action? | Optional action invoked when the source completes. |
Returns: IDisposable -- A tracked subscription.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext is null. |
3. Overload¶
protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted, bool refreshAfterCallbacks)
Summary: Subscribes to a source and refreshes the component after each observed signal.
Type parameters
| Name | Description |
|---|---|
T | The source value type. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The source sequence. |
onNext | Action | Action invoked for each value on the Blazor renderer dispatcher. |
onError | Action | Optional action invoked when the source errors. |
onCompleted | Action? | Optional action invoked when the source completes. |
refreshAfterCallbacks | bool | A value indicating whether to call StateHasChanged after callbacks. |
Returns: IDisposable -- A tracked subscription.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext is null. |