Skip to content

,System.Action,System.Action)}

DelegateWitness(Action, Action?, Action?) constructor

Defined in

Type: DelegateWitness Namespace: ReactiveUI.Primitives.Signals Assembly: ReactiveUI.Primitives.Core.dll

Applies to

net10.0, net10.0, net10.0-desktop1.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-browserwasm1.0, net9.0, net9.0, net9.0-desktop1.0, net9.0-desktop1.0, net9.0-browserwasm1.0, net9.0-browserwasm1.0, net8.0, net8.0, net8.0-ios17.5, net8.0-macos14.5, net8.0-macos14.5, net8.0-macos14.2, net8.0-macos14.2, net8.0-maccatalyst17.5, net8.0-maccatalyst17.5, net8.0-tvos17.2, net8.0-tvos17.2, net8.0-ios17.5, netstandard2.1, netstandard2.1, net481, net462, net462, net481

public DelegateWitness(Action<T> onNext, Action<Exception>? onError = null, Action? onCompleted = null)

View source

Summary: A lightweight IObserver that forwards each notification to the supplied delegates. Use it to subscribe to an IObservable without allocating a bespoke observer class. The onError and onCompleted delegates are optional; when omitted the corresponding terminal notification is ignored.

Parameters

NameTypeDescription
onNextActionThe delegate invoked with each value pushed to OnNext.
onError = nullAction?The optional delegate invoked with the exception when the sequence faults via OnError.
onCompleted = nullAction?The optional delegate invoked when the sequence finishes via OnCompleted.