isValidLink function
Checks if a link is still valid for a subscriber.
Parameters:
checkLink: The link to checksub: The subscriber node
Returns: true if the link is still valid
Example:
final effectNode = CustomEffectNode();
final link = effectNode.depsTail!;
final stillValid = isValidLink(link, effectNode);
Implementation
@pragma("vm:prefer-inline")
@pragma("wasm:prefer-inline")
@pragma("dart2js:prefer-inline")
bool isValidLink(Link checkLink, ReactiveNode sub) {
var link = sub.depsTail;
while (link != null) {
if (link == checkLink) {
return true;
}
link = link.prevDep;
}
return false;
}