Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active March 20, 2017 22:08
Show Gist options
  • Save StevenJL/c0c976027ec2a7e7aca2 to your computer and use it in GitHub Desktop.
Save StevenJL/c0c976027ec2a7e7aca2 to your computer and use it in GitHub Desktop.
export function addTodo(text){
return {
type: "ADD_TODO",
text: text
}
}
export function completeTodo(index){
return {type: "COMPLETE_TODO", index}
}
export function setVisibilityFilter(filter){
return {type: "SET_VISBILITY_FILTER", filter
}
// assuming `appStore` is the application's store
// you can also send an action creator as an argument to `dispatch`
appStore.dispatch(completeTodo(5))
appStore.dispatch(addTodo("Watch 'Feeling Minnesota'"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment