Skip to content

Commit cce1519

Browse files
committed
refactor: do not mutate mutation payload in the todo app example
1 parent e012653 commit cce1519

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/todomvc/store/mutations.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const mutations = {
1515
},
1616

1717
editTodo (state, { todo, text = todo.text, done = todo.done }) {
18-
todo.text = text
19-
todo.done = done
18+
state.todos.splice(state.todos.indexOf(todo), 1, { ...todo, text, done })
2019
}
2120
}

0 commit comments

Comments
 (0)