Skip to content

Commit

Permalink
Backbone apps - simplify clearCompleted logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 6, 2013
1 parent 8e20c96 commit 7f17ef8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions architecture-examples/backbone/js/views/app.js
Expand Up @@ -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;
},

Expand Down
5 changes: 1 addition & 4 deletions dependency-examples/backbone_require/js/views/app.js
Expand Up @@ -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;
},

Expand Down

0 comments on commit 7f17ef8

Please sign in to comment.