code: function Manager(records) {
    let sel, nodes, node, vm;
  
    records.forEach(record => {
      nodes = record.removedNodes;
      if (!nodes || !nodes.length) return;
      vm = record.target ? select(record.target).view() : null;
  
      for (let i = 0; i < nodes.length; ++i) {
        node = nodes[i];
        if (!node.querySelectorAll || node.__d3_component__) continue;
        sel = select(node);
        if (vm || sel.view()) {
          sel.selectAll("*").each(destroy);
          destroy.call(nodes[i]);
        }
      }
    });
  }
docs: Clears element going out of scope