This project is unmaintained.
A couple of extra methods for Backbone.js, related to changing models and collections.
-
Backbone.Model#reset
resets attributes of the model, also unsetting attributes that no longer exist, and triggers a singleset
event. -
Backbone.Collection#delta
resets a collection, and triggers severaladd
,remove
, andchange
events, but falls back to a normalreset
when the contents has changed completely.
MIT licensed.
Include backbone-delta.js
or the minified version backbone-delta.min.js
in your page. If Backbone.js is loaded, it will automatically be extended.
Install using NPM:
npm install backbone-delta
In your code:
var Backbone = require('backbone');
require('backbone-delta').extend(Backbone);
git clone https://github.com/Two-Screen/backbone-delta.git
cd backbone-delta
npm install
npm test