Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
27bdc595
Commit
27bdc595
authored
Jun 29, 2014
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #937 from pgilad/patch-3
reduce redundant filter & without syntax
parents
81d044dc
68a2c2fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
architecture-examples/backbone/js/collections/todos.js
architecture-examples/backbone/js/collections/todos.js
+2
-4
No files found.
architecture-examples/backbone/js/collections/todos.js
View file @
27bdc595
...
...
@@ -18,14 +18,12 @@ var app = app || {};
// Filter down the list of all todo items that are finished.
completed
:
function
()
{
return
this
.
filter
(
function
(
todo
)
{
return
todo
.
get
(
'
completed
'
);
});
return
this
.
where
({
completed
:
true
});
},
// Filter down the list to only todo items that are still not finished.
remaining
:
function
()
{
return
this
.
w
ithout
.
apply
(
this
,
this
.
completed
()
);
return
this
.
w
here
({
completed
:
false
}
);
},
// We keep the Todos in sequential order, despite being saved by unordered
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment