Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Proposal of an unhosted persistent graph.

  • Loading branch information...
commit 658e12f458901cf3a38b20aab1d0abd51b578124 1 parent e73c976
Michael Aufreiter authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/unhosted/unhosted_graph.js
View
21 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.
+ }
+});
Please sign in to comment.
Something went wrong with that request. Please try again.