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.
Written by Jesse O'Brien
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Parse
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#