csharp
public readonly record struct AsyncValue<T>The three states of an asynchronous derivation, as one value.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One value rather than three signals, because the three are not independent and a UI that binds them separately can render a spinner over a stale value over an error message. Binding one thing makes the exclusive cases exclusive.
Fields and properties (5)
public AsyncStatus StatusWhere the work has got to.
public T? ValueThe result, if there is one. Kept across a reload so a panel does not blank.
public Exception? ErrorWhy it failed, if it did.
public bool IsLoadingWhether the work is running.
public bool HasValueWhether a result is present, even if a reload is in flight.
Methods (1)
public AsyncValue(AsyncStatus Status, T? Value = default(T?), Exception? Error = null)The three states of an asynchronous derivation, as one value.
Used by (2)
- AsyncComputedVixen.Ui.Reactive
- AsyncComputedTestsVixen.Ui.Reactive.Tests