shallowPropagate method

void shallowPropagate(
  1. Link link
)

Propagates changes shallowly through the reactive graph starting from link.

Unlike propagate, this method only processes immediate subscribers without traversing deeper into the dependency graph. It marks subscribers as dirty if they are pending and notifies watchers when changes occur.

Implementation

void shallowPropagate(Link link) {
  Link? current = link;
  do {
    final sub = current!.sub;
    final flags = sub.flags;

    if ((flags & 48 /* Pending | Dirty */) == 32 /* Pending */) {
      sub.flags = flags | 16 /* Dirty */;
      if ((flags & 2 /* Watching */) != 0) {
        notify(sub);
      }
    }
  } while ((current = current.nextSub) != null);
}