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

Backbone apps - simplify `clearCompleted` logic

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