Skip to content

Instantly share code, notes, and snippets.

@paulsturgess
Created February 8, 2017 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulsturgess/dc495342470f006a6c60a97d29584456 to your computer and use it in GitHub Desktop.
Save paulsturgess/dc495342470f006a6c60a97d29584456 to your computer and use it in GitHub Desktop.
An example mapDispatchToProps when using redux-thunk middleware
const mapDispatchToProps = (dispatch, ownProps) => ({
saveResource: (resource, event) => {
Actions.saveResource(resource)(dispatch);
},
toggleSomething: (id, event) => {
dispatch(Actions.toggleSomething(id));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment