Commit 7f17ef8f authored by Sindre Sorhus's avatar Sindre Sorhus

Backbone apps - simplify `clearCompleted` logic

parent 8e20c96c
......@@ -111,10 +111,7 @@ $(function( $ ) {
// Clear all completed todo items, destroying their models.
clearCompleted: function() {
_.each( app.Todos.completed(), function( todo ) {
todo.destroy();
});
_.invoke(app.Todos.completed(), 'destroy');
return false;
},
......
......@@ -112,10 +112,7 @@ define([
// Clear all completed todo items, destroying their models.
clearCompleted: function() {
_.each( Todos.completed(), function( todo ) {
todo.destroy();
});
_.invoke(Todos.completed(), 'destroy');
return false;
},
......
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