isValidLink function

bool isValidLink(
  1. Link checkLink,
  2. ReactiveNode sub
)

Checks if a link is still valid for a subscriber.

Parameters:

  • checkLink: The link to check
  • sub: The subscriber node

Returns: true if the link is still valid

Implementation

@pragma('vm:prefer-inline')
@pragma('wasm:prefer-inline')
@pragma('dart2js:prefer-inline')
bool isValidLink(Link checkLink, ReactiveNode sub) {
  Link? link = sub.depsTail;

  while (link != null) {
    if (link == checkLink) {
      return true;
    }
    link = link.prevDep;
  }
  return false;
}