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
5df2fd43
Commit
5df2fd43
authored
Aug 12, 2014
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #966 from cirocosta/react-comments
React comments - limit to 80 columns
parents
e4f28fd2
82bd36a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
architecture-examples/react/js/todoItem.jsx
architecture-examples/react/js/todoItem.jsx
+5
-4
architecture-examples/react/js/todoModel.js
architecture-examples/react/js/todoModel.js
+3
-3
No files found.
architecture-examples/react/js/todoItem.jsx
View file @
5df2fd43
...
...
@@ -57,10 +57,11 @@ var app = app || {};
},
/**
* This is a completely optional performance enhancement that you can implement
* on any React component. If you were to delete this method the app would still
* work correctly (and still be very performant!), we just use it as an example
* of how little code it takes to get an order of magnitude performance improvement.
* This is a completely optional performance enhancement that you can
* implement on any React component. If you were to delete this method
* the app would still work correctly (and still be very performant!), we
* just use it as an example of how little code it takes to get an order
* of magnitude performance improvement.
*/
shouldComponentUpdate
:
function
(
nextProps
,
nextState
)
{
return
(
...
...
architecture-examples/react/js/todoModel.js
View file @
5df2fd43
...
...
@@ -43,9 +43,9 @@ var app = app || {};
app
.
TodoModel
.
prototype
.
toggleAll
=
function
(
checked
)
{
// Note: it's usually better to use immutable data structures since they're
// easier to reason about and React works very well with them. That's why
we
//
use map() and filter() everywhere instead of mutating the array or todo
// items themselves.
// easier to reason about and React works very well with them. That's why
//
we use map() and filter() everywhere instead of mutating the array or
//
todo
items themselves.
this
.
todos
=
this
.
todos
.
map
(
function
(
todo
)
{
return
Utils
.
extend
({},
todo
,
{
completed
:
checked
});
});
...
...
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