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
2528e217
Commit
2528e217
authored
Jun 29, 2014
by
Gilad Peleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce redundant filter & without syntax
parent
81d044dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
labs/dependency-examples/backbone_marionette_require/js/collections/TodoList.js
...es/backbone_marionette_require/js/collections/TodoList.js
+2
-6
No files found.
labs/dependency-examples/backbone_marionette_require/js/collections/TodoList.js
View file @
2528e217
...
@@ -7,21 +7,17 @@ define([
...
@@ -7,21 +7,17 @@ define([
],
function
(
Backbone
,
Todo
)
{
],
function
(
Backbone
,
Todo
)
{
'
use strict
'
;
'
use strict
'
;
function
isCompleted
(
todo
)
{
return
todo
.
get
(
'
completed
'
);
}
return
Backbone
.
Collection
.
extend
({
return
Backbone
.
Collection
.
extend
({
model
:
Todo
,
model
:
Todo
,
localStorage
:
new
Backbone
.
LocalStorage
(
'
todos-backbone
'
),
localStorage
:
new
Backbone
.
LocalStorage
(
'
todos-backbone
'
),
getCompleted
:
function
()
{
getCompleted
:
function
()
{
return
this
.
filter
(
isCompleted
);
return
this
.
where
({
completed
:
true
}
);
},
},
getActive
:
function
()
{
getActive
:
function
()
{
return
this
.
reject
(
isCompleted
);
return
this
.
where
({
completed
:
false
}
);
},
},
comparator
:
function
(
todo
)
{
comparator
:
function
(
todo
)
{
...
...
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