Commit c4c8e3ee authored by ben hockey's avatar ben hockey

use the length of a filtered array rather than keep a running count

parent d502e4eb
...@@ -88,13 +88,9 @@ define(["dojo/_base/declare", "dojox/mvc/StatefulModel", "todo/store/LocalStorag ...@@ -88,13 +88,9 @@ define(["dojo/_base/declare", "dojox/mvc/StatefulModel", "todo/store/LocalStorag
* cause the bound "complete" value to be updated as well. * cause the bound "complete" value to be updated as well.
*/ */
updateTotalItemsLeft: function () { updateTotalItemsLeft: function () {
var remaining = 0; this.incomplete.set("value", array.filter(this.todos, function (item) {
return item && !item.isDone.value;
array.forEach(this.todos, function (item) { }).length);
item && !item.isDone.value && remaining++;
});
this.incomplete.set("value", remaining);
} }
}); });
}); });
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