<PackageReference Include="ReactiveUI.Primitives.Core" Version="10.0.0" />

ReactiveUI.Primitives.Signals.Signal<T>

public class Signal<T> : ISignal<T>, ISignal<T, T>, IObserver<T>, IObservable<T>, IsDisposed, IDisposable
A signal that is both an observer and observable of values.
public virtual bool HasObservers { get; }

Gets a value indicating whether any observer is subscribed to the signal.

public virtual bool IsDisposed { get; }

Gets a value indicating whether the signal has been disposed.

public Signal()

public void Dispose()

Detaches every subscription and makes later notifications throw.

protected virtual void Dispose(bool disposing)

Publishes the disposed marker and detaches the subscriptions it replaced.

public void OnCompleted()

Completes the current observers and stops the signal, so later notifications are ignored.

public void OnError(Exception error)

Faults the current observers and stops the signal, rethrowing to the caller when a value-only callback is subscribed.

public void OnNext(T value)

Emits a value to the current observers; a stopped signal drops it and a disposed signal throws ObjectDisposedException.

public IDisposable Subscribe(IObserver<T> observer)

Subscribes an observer, delivering the stored terminal notification immediately when the signal has stopped.

Registers a value-only callback, rethrowing the stored error when the signal has faulted.