A couple of extra methods for Backbone.js, related to changing models and collections.
Backbone.Model#resetresets attributes of the model, also unsetting attributes that no longer exist, and triggers a single
Backbone.Collection#deltaresets a collection, and triggers several
changeevents, but falls back to a normal
resetwhen the contents has changed completely.
From the browser
Install using NPM:
npm install backbone-delta
In your code:
var Backbone = require('backbone'); require('backbone-delta').extend(Backbone);
Hacking the code
git clone https://github.com/Two-Screen/backbone-delta.git cd backbone-delta npm install npm test