computedNotify<T> method

void computedNotify<T>(
  1. Computed<T> computed
)

Force update a computed without changing its value

Implementation

@pragma('vm:prefer-inline')
@pragma('wasm:prefer-inline')
@pragma('dart2js:prefer-inline')
void computedNotify<T>(Computed<T> computed) {
  updateComputed(computed);

  Link? subs = computed.subs;

  while (subs != null) {
    subs.sub.flags |= 32 /* ReactiveFlags.pending */;
    shallowPropagate(subs);
    subs = subs.nextSub;
  }

  if (computed.subs != null && batchDepth == 0) {
    flush();
  }

  assert(() {
    getJoltDebugFn(computed)?.call(DebugNodeOperationType.notify, computed);
    return true;
  }());
}