-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
I've recently used a similar mixin for React. What I've seen so far with using it is that N number additions to a collection triggers forceUpdate N number times.
I changed:
model.on('add remove reset sort', function () { this.forceUpdate(); }, this);
to this (assuming inclusion of underscore or lo-dash):
this._throttledForceUpdate = _.throttle(this.forceUpdate.bind(this, null), 1000);
model.on('add remove reset sort', this._throttledForceUpdate, this);
At most, force update will be called once a second here. Interested in your thoughts on this.
Metadata
Metadata
Assignees
Labels
No labels