diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-11-17 13:30:06 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-19 23:21:42 +0200 |
| commit | a2c1a7b364bc9d1092aaa4af095b495f0da1384f (patch) | |
| tree | 32ecf746d3bd0bc29d07a6faa419cc5f20115b44 | |
| parent | cbf03e61c2f052bad71345b7ff8348ad8d4186c2 (diff) | |
Topo_Diff - for_each_X() convenience functions
| -rw-r--r-- | src/model/diff.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/diff.js b/src/model/diff.js index 1bcfc5a2..ca9c41c9 100644 --- a/src/model/diff.js +++ b/src/model/diff.js @@ -35,6 +35,22 @@ define([], this.node_set_rm = obj_spec.node_set_rm; this.node_set_add = obj_spec.node_set_add; this.link_set_add = obj_spec.link_set_add; + + } + Topo_Diff.prototype.for_each_node_add = function(callback, this_arg) { + this.node_set_add.forEach(callback, this_arg); + } + + Topo_Diff.prototype.for_each_node_rm = function(callback, this_arg) { + this.node_set_rm.forEach(callback, this_arg); + } + + Topo_Diff.prototype.for_each_link_add = function(callback, this_arg) { + this.link_set_add.forEach(callback, this_arg); + } + + Topo_Diff.prototype.for_each_link_rm = function(callback, this_arg) { + this.link_set_rm.forEach(callback, this_arg); } /** |
