propagate method
Propagates changes through the reactive graph.
Parameters:
theLink: The link to start propagation from
Implementation
void propagate(Link theLink) {
Link? link = theLink;
Link? next = link.nextSub;
Stack<Link?>? stack;
top:
do {
final sub = link!.sub;
int flags = sub.flags;
if (flags &
60 /** ReactiveFlags.recursedCheck | ReactiveFlags.recursed | ReactiveFlags.dirty | ReactiveFlags.pending */ ==
0) {
sub.flags = flags | 32 /* ReactiveFlags.pending */;
} else if (flags &
12 /** ReactiveFlags.recursedCheck | ReactiveFlags.recursed */ ==
0) {
flags = 0 /* ReactiveFlags.none */;
} else if (flags & 4 /** ReactiveFlags.recursedCheck */ == 0) {
sub.flags = (flags & ~(8 /* ReactiveFlags.recursed */)) |
32 /* ReactiveFlags.pending */;
} else if (flags &
48 /** ReactiveFlags.dirty | ReactiveFlags.pending */ ==
0 &&
isValidLink(link, sub)) {
sub.flags =
flags | 40 /* ReactiveFlags.recursed | ReactiveFlags.pending */;
flags &= 1 /* ReactiveFlags.mutable */;
} else {
flags = 0 /* ReactiveFlags.none */;
}
if (flags & 2 /** ReactiveFlags.watching */ != 0) {
notify(sub);
}
if (flags & 1 /** ReactiveFlags.mutable */ != 0) {
final subSubs = sub.subs;
if (subSubs != null) {
final nextSub = (link = subSubs).nextSub;
if (nextSub != null) {
stack = Stack(value: next, prev: stack);
next = nextSub;
}
continue;
}
}
if ((link = next) != null) {
next = link!.nextSub;
continue;
}
while (stack != null) {
link = stack.value;
stack = stack.prev;
if (link != null) {
next = link.nextSub;
continue top;
}
}
break;
} while (true);
}