Skip to content

Instantly share code, notes, and snippets.

@mikeric
Created July 31, 2012 20:51
Show Gist options
  • Save mikeric/3220406 to your computer and use it in GitHub Desktop.
Save mikeric/3220406 to your computer and use it in GitHub Desktop.
Stapes.js adapter for Rivets.js
rivets.configure({
adapter: {
subscribe: function(obj, keypath, callback) {
obj.on("change:" + keypath, callback);
},
unsubscribe: function(obj, keypath, callback) {
obj.off("change:" + keypath, callback);
},
read: function(obj, keypath) {
return obj.get(keypath);
},
publish: function(obj, keypath, value) {
obj.set(keypath, value);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment