Skip to content

Commit 2b1a476

Browse files
committed
Sketch implementation for removing nodes on destroy. Towards #12
1 parent b0dc02f commit 2b1a476

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,21 @@ function ReactiveFunction(options){
9797
graph.removeEdge(input.id, output.id);
9898
});
9999

100+
// Remove property nodes from the dependency graph if they have no edges connected.
101+
//inputs.concat([output]).forEach(function (property){
102+
// var noOutgoing = (graph.outgoing(property.id).length === 0);
103+
// var noIncoming = (graph.incoming(property.id).length === 0);
104+
// inDegree, outDegree?
105+
// if(noOutgoing && noIncoming){
106+
// graph.removeNode(property.id);
107+
// }
108+
//});
109+
100110
// Remove the reference to the 'evaluate' function.
101111
delete output.evaluate;
102112

113+
// Remove references to everything.
114+
inputs = callback = output = undefined;
103115
}
104116
};
105117
}

0 commit comments

Comments
 (0)