gc method
Implementation
Future<int> gc([bool nested = false]) async {
Iterable<Node> c = nodes.where((i) => !i.$rootNode && !i.$hasReferences);
List<Future<void>> work = [];
while (c.isNotEmpty) {
for (Node n in c.toList()) {
work.add(removeNode(n.runtimeType, tag: n.$tag));
}
await Future.wait(work);
c = nodes.where((i) => !i.$rootNode && !i.$hasReferences);
}
return work.length;
}