Skip to content

Instantly share code, notes, and snippets.

@baptistemanson
Created July 20, 2017 19:44
Show Gist options
  • Save baptistemanson/b05a4d94f25a93591302118ad81bde09 to your computer and use it in GitHub Desktop.
Save baptistemanson/b05a4d94f25a93591302118ad81bde09 to your computer and use it in GitHub Desktop.
// 1 - instead of
const mapDispatchToProps = dispatch => {
return {
addUser: payload => dispatch({type:'my-app/users/ADD',payload})
}
}
const connect(null, mapDispatchToProps)(MyComponent)
// 2 - with action creators
import {addUser} from './redux/users'
const connect(null, {addUser})(MyComponent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment