shallowPropagate method

void shallowPropagate(
  1. ReactiveLink link
)

Promotes pending subscribers of a node that confirmed a change to dirty, notifying watchers. Non-recursive: touches immediate subscribers only.

Promove subscribers pending de um nó que confirmou mudança para dirty, notificando watchers. Não recursivo: toca apenas os subscribers imediatos.

Implementation

@pragma('vm:align-loops')
void shallowPropagate(ReactiveLink link) {
  ReactiveLink? curr = link;
  do {
    final ReactiveNode sub = curr!.sub;
    final ReactiveFlags flags = sub.flags;
    if ((flags & ReactiveFlags.stale) == ReactiveFlags.pending) {
      sub.flags = flags | ReactiveFlags.dirty;
      if ((flags & ReactiveFlags.watchingOrChecking) ==
          ReactiveFlags.watching) {
        notify(sub);
      }
    }
  } while ((curr = curr.nextSub) != null);
}