src/core/clean.js
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]);
      }
    }
  });
}
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]);
      }
    }
  });
}
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 ] ) ; } } } ) ; }
Clears element going out of scope
Clears element going out of scope