Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(function(){
var links = FileLink.all.getValues(function(link){
return [link.data.from, link.data.to];
});
File.all.addHandler({
itemsChanged: function(dataset, delta){
if (delta.deleted)
delta.deleted.forEach(function(file){
graph.removeNode(file.getId());
});
}
});
FileLink.all.addHandler({
itemsChanged: function(dataset, delta){
if (delta.inserted)
delta.inserted.forEach(function(link){
(function(){
var links = FileLink.all.getValues(function(link){
return [link.data.from, link.data.to];
});
File.all.addHandler({
itemsChanged: function(dataset, delta){
if (delta.deleted)
delta.deleted.forEach(function(file){
graph.removeNode(file.getId());
});
}
});
FileLink.all.addHandler({
itemsChanged: function(dataset, delta){
if (delta.inserted)
delta.inserted.forEach(function(link){
return links.push([link.data.from, link.data.to]);
});
if (delta.deleted)
delta.deleted.forEach(function(link){
graph.removeLink(link.data.from, link.data.to);
});
}
});
(function popNode(){
if (links.length)
{