shallowPropagate method
Propagates changes to immediate subscribers only.
Unlike propagate, this method only marks direct subscribers as dirty without recursive traversal. Used when a node's value has been confirmed to change and all immediate dependents need notification.
Typically called after successful updates to notify immediate subscribers that their dependency has changed.
Implementation
@pragma('vm:align-loops')
void shallowPropagate(Link link) {
Link? curr = link;
do {
final sub = curr!.sub, flags = sub.flags;
if ((flags & 48 /*(ReactiveFlags.pending | ReactiveFlags.dirty)*/) ==
ReactiveFlags.pending) {
sub.flags = flags | ReactiveFlags.dirty;
if ((flags &
6 /*(ReactiveFlags.watching | ReactiveFlags.recursedCheck)*/) ==
ReactiveFlags.watching) {
notify(sub);
}
}
} while ((curr = curr.nextSub) != null);
}