stop function

void stop(
  1. ReactiveNode node
)

Stops a reactive node and removes it from the reactive system.

Clears all dependencies and subscribers of the node, effectively removing it from the dependency graph. After calling this, the node will no longer respond to or trigger reactive updates.

This is essential for cleanup to prevent memory leaks.

Implementation

void stop(ReactiveNode node) {
  node.depsTail = null;
  node.flags = ReactiveFlags.none;
  purgeDeps(node);
  final subs = node.subs;
  if (subs != null) {
    unlink(subs, subs.sub);
  }
}