Skip to content

,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)

View source

Summary: Subscribes to a source and refreshes the component after each value.

Type parameters

NameDescription
TThe source value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionAction invoked for each value on the Blazor renderer dispatcher.

Returns: IDisposable -- A tracked subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or onNext is null.

2. Overload

protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted)

View source

Summary: Subscribes to a source and refreshes the component after each observed signal.

Type parameters

NameDescription
TThe source value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionAction invoked for each value on the Blazor renderer dispatcher.
onErrorAction?Optional action invoked when the source errors.
onCompletedAction?Optional action invoked when the source completes.

Returns: IDisposable -- A tracked subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or onNext is null.

3. Overload

protected IDisposable Observe<T>(IObservable<T> source, Action<T> onNext, Action<Exception>? onError, Action? onCompleted, bool refreshAfterCallbacks)

View source

Summary: Subscribes to a source and refreshes the component after each observed signal.

Type parameters

NameDescription
TThe source value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionAction invoked for each value on the Blazor renderer dispatcher.
onErrorAction?Optional action invoked when the source errors.
onCompletedAction?Optional action invoked when the source completes.
refreshAfterCallbacksboolA value indicating whether to call StateHasChanged after callbacks.

Returns: IDisposable -- A tracked subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or onNext is null.