3246edc1 by Michael Richards

Update the README with simplified subscribe/unsubscribe implementations in the example adapter.

1 parent 3f1df5a3
......@@ -43,11 +43,10 @@ Rivets.js is model interface-agnostic, meaning it can work with any event-driven
rivets.configure({
adapter: {
subscribe: function(obj, keypath, callback) {
callback.wrapped = function(m, v) { callback(v) };
obj.on('change:' + keypath, callback.wrapped);
obj.on('change:' + keypath, callback);
},
unsubscribe: function(obj, keypath, callback) {
obj.off('change:' + keypath, callback.wrapped);
obj.off('change:' + keypath, callback);
},
read: function(obj, keypath) {
return obj.get(keypath);
......