Skip to content

Instantly share code, notes, and snippets.

@fouad
Forked from crcn/mesh-model.js
Last active August 29, 2015 14:18
Show Gist options
  • Save fouad/50be1722f110140c0b45 to your computer and use it in GitHub Desktop.
Save fouad/50be1722f110140c0b45 to your computer and use it in GitHub Desktop.
// model(db, query)
var model = mesh.model(db, { _id: "ball" });
// watch entire model
model.watch(function() {
});
// watch specific props (delta)
model.watch({active: true}, function() {
});
model.save(function() {
});
model.load(function() {
});
// model.[watch|load]([props], callback)
model.set("active", !model.active);
model.save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment