cleanupOrphanNodes method

void cleanupOrphanNodes()

Clean up all orphan app state variable nodes.

Call periodically to reclaim memory from unused variable nodes.

Implementation

void cleanupOrphanNodes() {
  _nodes.removeWhere(
    (key, node) =>
        NodeIds.isAppStateVarNodeId(key) && node.importedBy.isEmpty,
  );
}