Vixen
02b45cc4
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 Status

    Where the work has got to.

  • public T? Value

    The result, if there is one. Kept across a reload so a panel does not blank.

  • public Exception? Error

    Why it failed, if it did.

  • public bool IsLoading

    Whether the work is running.

  • public bool HasValue

    Whether 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