Skip to content

Commit

Permalink
Add throttled backbone updated; fixes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
clayallsopp committed Feb 3, 2014
1 parent c2c9d2d commit 865e322
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion react.backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
}
// Detect if it's a collection
if (model instanceof Backbone.Collection) {
model.on('add remove reset sort', function () { this.forceUpdate(); }, this);
var _throttledForceUpdate = _.throttle(this.forceUpdate.bind(this, null), 500);
model.on('add remove reset sort', _throttledForceUpdate, this);
}
else if (model) {
var changeOptions = this.changeOptions || 'change';
Expand Down

1 comment on commit 865e322

@duhseekoh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good!

Please sign in to comment.