Skip to content

Instantly share code, notes, and snippets.

@Neener54
Last active August 29, 2015 14:06
Show Gist options
  • Save Neener54/9e4a1717b338ea6ed9c5 to your computer and use it in GitHub Desktop.
Save Neener54/9e4a1717b338ea6ed9c5 to your computer and use it in GitHub Desktop.
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