Created
July 20, 2017 19:44
-
-
Save baptistemanson/b05a4d94f25a93591302118ad81bde09 to your computer and use it in GitHub Desktop.
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
// 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