Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created April 4, 2011 21:19
Show Gist options
  • Save indexzero/902460 to your computer and use it in GitHub Desktop.
Save indexzero/902460 to your computer and use it in GitHub Desktop.
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