Skip to content

Commit

Permalink
Proposal of an unhosted persistent graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael committed Apr 15, 2012
1 parent e73c976 commit 658e12f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions 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.