Last active
December 30, 2017 00:48
-
-
Save francisngo/cf0aa45376a6db0c5ed0ac7b8bdd7292 to your computer and use it in GitHub Desktop.
Collection for Redux todo example - This file defines the action types and actionCreators helper functions to create actions.
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
export const types = { | |
ADDTODO: 'ADD_TODO', | |
REMOVETODO: 'REMOVE_TODO' | |
}; | |
export const actionCreators = { | |
addTodo: item => { | |
return { | |
type: types.ADDTODO, | |
payload: item | |
}; | |
}, | |
removeTodo: index => { | |
return { | |
type: types.REMOVETODO, | |
payload: index | |
}; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment