AsyncState<T>.forCell constructor

AsyncState<T>.forCell(
  1. FutureCell<T> cell
)

Create an async state for a cell holding a Future.

  1. If the Future held in cell is pending, an AsyncStateLoading state is returned.

  2. If the Future held in cell is complete with a value, an AsyncStateData state is returned.

  3. If the Future held in cell completed with an error, an AsyncStateError state is returned.

Implementation

factory AsyncState.forCell(FutureCell<T> cell) =>
    makeState(current: cell.awaited);