Commit 126cdd04 authored by Addy Osmani's avatar Addy Osmani

Merge pull request #664 from smelnikov/gh-pages

use fetch({reset:true}) for 2x-5x increase in processing performance for backbone.
parents cbcc29a9 a67903a1
......@@ -39,7 +39,10 @@ var app = app || {};
this.listenTo(app.todos, 'filter', this.filterAll);
this.listenTo(app.todos, 'all', this.render);
app.todos.fetch();
//suppresses 'add' events with {reset: true} and prevents the app view
//from being re-rendered for every model.
//Only renders when the 'reset' event is triggered at the end of the fetch.
app.todos.fetch({reset: true});
},
// Re-rendering the App just means refreshing the statistics -- the rest
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment