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
782fdad4
Commit
782fdad4
authored
Jun 29, 2014
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #934 from pgilad/patch-1
reduce redundant filter & without syntax
parents
4acb4d47
c81b9d1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
dependency-examples/backbone_require/js/collections/todos.js
dependency-examples/backbone_require/js/collections/todos.js
+2
-4
No files found.
dependency-examples/backbone_require/js/collections/todos.js
View file @
782fdad4
...
@@ -16,14 +16,12 @@ define([
...
@@ -16,14 +16,12 @@ define([
// Filter down the list of all todo items that are finished.
// Filter down the list of all todo items that are finished.
completed
:
function
()
{
completed
:
function
()
{
return
this
.
filter
(
function
(
todo
)
{
return
this
.
where
({
completed
:
true
});
return
todo
.
get
(
'
completed
'
);
});
},
},
// Filter down the list to only todo items that are still not finished.
// Filter down the list to only todo items that are still not finished.
remaining
:
function
()
{
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
// 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