Skip to content

Instantly share code, notes, and snippets.

@francisngo
Last active December 30, 2017 00:48
Show Gist options
  • Save francisngo/cf0aa45376a6db0c5ed0ac7b8bdd7292 to your computer and use it in GitHub Desktop.
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.
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