BehaviorSubject.Value property¶
Defined in
Type: BehaviorSubjectSystem.Reactive.Subjects
Assembly: System.Reactive.dll
Applies to
netstandard2.0
public T Value { get; }
Summary: Gets the current value or throws an exception.
Returns: T
Value: The initial value passed to the constructor until OnNext is called; after which, the last value passed to OnNext.
Remarks
Value is frozen after OnCompleted is called.
After OnError is called, Value always throws the specified exception.
An exception is always thrown after Dispose is called.
Reading Value is a thread-safe operation, though there's a potential race condition when OnNext or OnError are being invoked concurrently. In some cases, it may be necessary for a caller to use external synchronization to avoid race conditions.
Exceptions
| Type | Condition |
|---|---|
| System.ObjectDisposedException | Dispose was called. |