Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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