notifyComputed<T> function

void notifyComputed<T>(
  1. ComputedReactiveNode<T> computed
)

Invalidates a computed node and notifies its subscribers without assigning a new value.

Parameters:

  • computed: Node to invalidate

Example:

final cacheBustingComputed = CustomComputedNode<int>(() => 0);
notifyComputed(cacheBustingComputed);

Implementation

@pragma("vm:prefer-inline")
@pragma("wasm:prefer-inline")
@pragma("dart2js:prefer-inline")
void notifyComputed<T>(ComputedReactiveNode<T> computed) {
  updateComputed(computed);

  var subs = computed.subs;

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

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

  JoltDebug.notify(computed);
}