forked from RomeldaB/Todo-React-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement edit todo functionality
- Loading branch information
1 parent
72d34db
commit e5aa430
Showing
5 changed files
with
88 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
export const ADD_TODO = "addTodo"; | ||
export const DEL_TODO = "deleteTodo"; | ||
export const EDIT_TODO = "editTodo"; | ||
|
||
export const addTodo = (data) => { | ||
export const addTodo = data => { | ||
return { | ||
type: ADD_TODO, | ||
data, | ||
data | ||
}; | ||
}; | ||
|
||
export const deleteTodo = (id) => { | ||
export const deleteTodo = id => { | ||
return { | ||
type: DEL_TODO, | ||
id | ||
}; | ||
}; | ||
|
||
export const editTodo = (id, newText) => { | ||
return { | ||
type: EDIT_TODO, | ||
id, | ||
newText | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters