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

ReactiveUI.Primitives.Signals.ReadOnlyState<T>

public sealed class ReadOnlyState<T> : IObservable<T>, IDisposable
Read-only latest-value signal for projected or externally owned state.
public IObservable<T> Changed { get; }

Gets the stream of current and subsequent values.

public T Value { get; }

Gets the current value.

public ReadOnlyState(IObservable<T> source, T initialValue)

Initializes a new instance of the ReadOnlyState<T> class.

public void Dispose()

Stops mirroring the source and disposes the cached state.

public IDisposable Subscribe(IObserver<T> observer)

Subscribes an observer, which receives the current value followed by every later one.