Skip to content

Commit

Permalink
refactor(todomvc): use new state.compute syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski authored and Guria committed Oct 26, 2016
1 parent 9e043c2 commit 290ef09
Showing 1 changed file with 3 additions and 3 deletions.
@@ -1,9 +1,9 @@
import isAllChecked from '../../../computed/isAllChecked'
import visibleTodosRefs from '../../../computed/visibleTodosRefs'

function toggleAllChecked ({controller, state}) {
const isCompleted = !isAllChecked().getValue(controller)
const currentTodosKeys = visibleTodosRefs().getValue(controller)
function toggleAllChecked ({state}) {
const isCompleted = !state.compute(isAllChecked())
const currentTodosKeys = state.compute(visibleTodosRefs())

currentTodosKeys.forEach((ref) => {
state.set(`app.todos.${ref}.completed`, isCompleted)
Expand Down

0 comments on commit 290ef09

Please sign in to comment.