doc mutations

main
Yanick Champoux 2023-03-02 14:03:01 -05:00
parent ea724ab73b
commit 29d3d9a2aa
1 changed files with 2 additions and 3 deletions

View File

@ -69,11 +69,10 @@ console.log( todosDux.actions.addTodo('write tutorial') );
### Adding a mutation
Mutations are the reducing functions associated to actions. They
are defined via the `setMutation` method:
are defined via the `mutation` method:
```js
todosDux.setMutation( 'addTodo', description => ({next_id: id, todos}) => ({
todosDux.mutation( addTodo, description => ({next_id: id, todos}) => ({
next_id: 1 + id,
todos: [...todos, { description, id, done: false }]
}));