Last Updated: February 25, 2016
·
1.54K
· jesseobrien

Backbone JS PATCH Syncing

When using the new PATCH functionality in backbone.js and you want it to update the model with any changes that have happened server-side (say two users may be editing one form or something) there is a parse directive you can use.

MyModel.save(key, value, { patch: true, parse: true });

So long as you return the full model back in the PATCH request, it will parse that model and add any changes to MyModel.changed once the request succeeds.