Skip to content

Commit

Permalink
Apply makeActionCreator for add
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimkorr committed May 3, 2021
1 parent 7dc31ae commit 11732aa
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/store/todo-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 6,10 @@ export const UPDATE_TODO_TEXT = 'UPDATE_TODO_TEXT'
export const UPDATE_TODO_DONE = 'UPDATE_TODO_DONE'
export const DELETE_TODO = 'DELETE_TODO'

export const addTodo = (text) => {
return {
type: ADD_TODO,
payload: {
id: uuid(),
text,
done: false,
},
}
}
export const addTodo = makeActionCreator(ADD_TODO, ['text'], {
id: () => uuid(),
done: () => false,
})

export const updateTodoText = makeActionCreator(UPDATE_TODO_TEXT, [
'id',
Expand Down

0 comments on commit 11732aa

Please sign in to comment.