<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.
namespace ReactiveUI.Primitives.Extensions { public sealed class CurrentValueSubject<[Nullable(2)] T> : IObservable<T>, IObserver<T>, IDisposable { public T Value { get; } public CurrentValueSubject(T initialValue); public void OnNext(T value); public void OnError(Exception error); public void OnCompleted(); public IDisposable Subscribe(IObserver<T> observer); public IObservable<T> AsObservable(); public void Dispose(); } }