Commit 5df2fd43 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #966 from cirocosta/react-comments

React comments - limit to 80 columns
parents e4f28fd2 82bd36a7
...@@ -57,10 +57,11 @@ var app = app || {}; ...@@ -57,10 +57,11 @@ var app = app || {};
}, },
/** /**
* This is a completely optional performance enhancement that you can implement * This is a completely optional performance enhancement that you can
* on any React component. If you were to delete this method the app would still * implement on any React component. If you were to delete this method
* work correctly (and still be very performant!), we just use it as an example * the app would still work correctly (and still be very performant!), we
* of how little code it takes to get an order of magnitude performance improvement. * just use it as an example of how little code it takes to get an order
* of magnitude performance improvement.
*/ */
shouldComponentUpdate: function (nextProps, nextState) { shouldComponentUpdate: function (nextProps, nextState) {
return ( return (
......
...@@ -43,9 +43,9 @@ var app = app || {}; ...@@ -43,9 +43,9 @@ var app = app || {};
app.TodoModel.prototype.toggleAll = function (checked) { app.TodoModel.prototype.toggleAll = function (checked) {
// Note: it's usually better to use immutable data structures since they're // 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 // easier to reason about and React works very well with them. That's why
// use map() and filter() everywhere instead of mutating the array or todo // we use map() and filter() everywhere instead of mutating the array or
// items themselves. // todo items themselves.
this.todos = this.todos.map(function (todo) { this.todos = this.todos.map(function (todo) {
return Utils.extend({}, todo, {completed: checked}); return Utils.extend({}, todo, {completed: checked});
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment