hoodiehq/backbone-hoodie — pull request #21 by laurens (2014-10-26 11:53:02+00:00)
Title: Improve sync

This PR improves the synchronization.

Instead of checking for `options.remote`, the event handlers for the hoodie store check for `options.backbone`.
If the change originates from Backbone it is ignored, otherwise the collection is updated.

That way, client-side changes to the hoodie store that are made outside of Backbone (e.g. directly via `hoodie.store.add('task', { name: 'new task'})`) will also be reflected in the collection. Previously only remote changes to the hoodie store were picked up.

Apart from that `Backbone.Model.prototype.merge` has been removed and `set()` is called directly.
`Backbone.Model.prototype.set` already takes care of only updating changed attributes.

The hoodie store methods will only get a specific set of `storeOptions`, instead of all the options that were passed to `Backbone.prototype.sync`.