get method

T? get()

Synchronous cached read.

An async computation returns its cached value when resolved and null otherwise. A synchronous computation created by AsyncContext.computed resolves inline when dirty, so queue-family reader kinds can stay deliberately uncoloured while still living on the async graph.

Implementation

T? get() {
  if (_nodeDisposed) throw DisposedNodeError(this);
  _ctx._track(this);
  if (_state == AsyncSlotState.resolved) return _value;
  final compute = _computeSync;
  return compute == null ? null : _resolveSync(compute);
}