Created
April 4, 2011 21:19
-
-
Save indexzero/902460 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var User = resourcer.define('User', function () { | |
}); | |
User.get('some-user', function (err, obj) { | |
obj.dont_update_me = 'foo'; | |
User.update('some-user', { update_this_instead: true }, function () { | |
// | |
// Both `dont_update_me` and `update_this_instead` will appear in the database | |
// because the cached object is merged with these changes and `obj` is a reference | |
// to that object. | |
// | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment