jmorrell / backbone.obscura

A read-only proxy of a Backbone.Collection that can be filtered, sorted, and paginated.
http://jmorrell.github.io/backbone.obscura/
MIT License
107 stars 19 forks source link

Prefer using collection.set when a full reset is unnecessary. #27

Closed ericmatthys closed 2 years ago

ericmatthys commented 9 years ago

Always using reset can be bad for performance when a filtered collection is being used to render a list. The entire list will be re-rendered any time the proxied collection is fetched, even if only a single model has an attribute change. Instead, use the collection's set method unless there is an explicit reset or the proxied collection has a comparator.