Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to use bindActionCreators provided by redux #192

Merged

Conversation

mauriciosoares
Copy link
Contributor

Hey there,

In this PR i simply refactor the mapDispatchToProps method to use bindActionCreators provided by the version of redux you're already using. It cleans up the code a little bit.

Instead of repeating a lot of boilerplate code, I just return all action creators as an object, and use a single line of code to define our `mapDispatchToProps`
@moroshko
Copy link
Owner

Thanks! It indeed makes the code a bit cleaner 👏

@moroshko moroshko merged commit 2a5e1fb into moroshko:master Jul 15, 2016
@moroshko
Copy link
Owner

@mauriciosoares I just discovered that you can pass actionCreators instead of mapDispatchToProps to connect(), so I updated the code accordingly.

@mauriciosoares
Copy link
Contributor Author

wow! thats pretty cool! I didnt know that.

Thanks for telling me 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants