diff --git a/example/index.js b/example/index.js index a7b3c09..c3a7f73 100644 --- a/example/index.js +++ b/example/index.js @@ -131,11 +131,21 @@ function todoStore (state, emitter) { if (todo.done) { var done = state.todos.done - var doneIndex = done[todo] + var doneIndex + done.forEach(function (_todo, j) { + if (_todo.id === id) { + doneIndex = j + } + }) done.splice(doneIndex, 1) } else { var active = state.todos.active - var activeIndex = active[todo] + var activeIndex + active.forEach(function (_todo, j) { + if (_todo.id === id) { + activeIndex = j + } + }) active.splice(activeIndex, 1) } emitter.emit('render') diff --git a/example/package.json b/example/package.json index 246ec0b..b47ffe7 100644 --- a/example/package.json +++ b/example/package.json @@ -9,7 +9,10 @@ "test": "standard && npm run deps && node test.js" }, "dependencies": { + "bel": "^4.5.1", "choo-expose": "^1.0.0", + "choo-log": "^5.0.0", + "choo-persist": "^3.0.0", "sheetify": "^6.0.1", "todomvc-app-css": "^2.0.6", "todomvc-common": "^1.0.3",