File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ https://github.com/tastejs/todomvc/blob/master/app-spec.md#counter
280280![ javascript-todo-list-count] ( https://user-images.githubusercontent.com/194400/73112092-e73a5400-3f04-11ea-90f6-d4ae541a129c.png )
281281
282282In order to display the ` count ` of items in the Todo list,
283- we could store 3 values in the model:
283+ we _ could _ store 3 values in the model:
284284
285285+ ` total_items ` - the total number of items, in this case 3.
286286+ ` completed_items ` - the number of completed items. in this case 1.
@@ -298,9 +298,10 @@ This is _unnecessary_ effort we can avoid.
298298We can simply _ compute_ these values based on the data in the ` todos ` Array
299299and display them for the user without storing any additional data.
300300
301- Rather than _ storing_ a ` counter ` in the model
302- (_ the count of active and completed Todo items_ )
303- we will _ compute_ (derive) it at "runtime" to keep the ` model ` simple.
301+ Instead of _ storing_ any additional data for a ` counter ` in the model
302+ (_ the count of active and completed Todo items_ ),
303+ we will _ compute_ the count and display the count at "runtime".
304+ We don't _ need_ to store any additional data in the ` model ` .
304305This may use a few CPU cycles computing the ` count `
305306each time the view is rendered but that's "OK"!
306307Even on an _ ancient_ Android device
You can’t perform that action at this time.
0 commit comments