Skip to content

Instantly share code, notes, and snippets.

@ralphholzmann
Forked from matthusby/gist:1595404
Created January 11, 2012 16:56
Show Gist options
  • Save ralphholzmann/1595611 to your computer and use it in GitHub Desktop.
Save ralphholzmann/1595611 to your computer and use it in GitHub Desktop.
success: function(data){
setTimeout(function(){
_.each( data.objects, function( obj ) {
var t = new Todo({
id: data.obj.id,
text: data.obj.text,
done: data.obj.done,
order: data.obj.order
});
if(typeof(Todos.get(t.id)) != "object"){
Todos.add(t);
} else {
console.log(t.id);
var r = Todos.get(t.id);
Todos.remove(r);
Todos.add(t);
}
});
}, 500);
waitForMsg(data.timestamp);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment