Permalink
Browse files

Proposal of an unhosted persistent graph.

  • Loading branch information...
1 parent e73c976 commit 658e12f458901cf3a38b20aab1d0abd51b578124 Michael Aufreiter committed Apr 15, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/unhosted/unhosted_graph.js
@@ -0,0 +1,21 @@
+Data.UnhostedGraph = function(graph) {
+ this.graph = new Data.Graph(graph);
+
+ this.dirtyNodes = [];
+}
+
+_.extend(Data.UnhostedGraph.prototype, _.Events {
+
+ set: function(n) {
+ var node = this.graph.set(n);
+ return node ? this.dirtyNodes.push(node) : null;
+ },
+
+ get: function(id) {
+ return this.graph.get(id);
+ },
+
+ sync: function() {
+ // send dirty nodes to the server.
+ }
+});

0 comments on commit 658e12f

Please sign in to comment.