Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3246edc1
authored
2012-09-02 17:08:53 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update the README with simplified subscribe/unsubscribe implementations in the example adapter.
1 parent
3f1df5a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
README.md
README.md
View file @
3246edc
...
...
@@ -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);
...
...
Please
register
or
sign in
to post a comment