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

ReactiveUI.Primitives.Extensions.CurrentValueSubject<T>

public sealed class CurrentValueSubject<T> : IObservable<T>, IObserver<T>, IDisposable
Thread-safe subject that holds the most-recently-emitted value, replays it to new subscribers, and broadcasts subsequent emissions. Per-emission hot path: Lock taken only to read the current observer state and update the cached value.Single-observer state lives in a dedicated field — no array allocated for the common case.Multi-observer state uses a copy-on-write IObserver{T}[] snapshot iterated outside the lock.
public T Value { get; }

Gets the most recently emitted value.

public CurrentValueSubject(T initialValue)

Initializes a new instance of the CurrentValueSubject<T> class with the supplied current value.

Returns an IObservable<T> view that hides the IObserver<T> side.

public void Dispose()

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)

public IDisposable Subscribe(IObserver<T> observer)