Skip to content

Fat arrow functions in the counter example #1942

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

Merged
merged 1 commit into from
Sep 12, 2016
Merged

Fat arrow functions in the counter example #1942

merged 1 commit into from
Sep 12, 2016

Conversation

ChrisJamesC
Copy link
Contributor

With this PR I would like to propose to add more ES6-like syntax in the examples.

This is an opinionated subject since we might want to stick with some more ES5-like syntax in order for new comers to not be intimidated by the syntax on top of redux.

Please let me know what you think.

@timdorr
Copy link
Member

timdorr commented Sep 12, 2016

This fits in well with what was leftover from #1800. Thanks!

@timdorr timdorr merged commit 72e4677 into reduxjs:master Sep 12, 2016
@ChrisJamesC
Copy link
Contributor Author

Thanks @timdorr for the quick review and for the reference to the issue!

@alexeyraspopov
Copy link
Contributor

What's the purpose of using arrow function instead of class method? It seems to be noisy.

@timdorr
Copy link
Member

timdorr commented Sep 12, 2016

@alexeyraspopov It auto binds the function. It removes the need to do manual binding like the example had before in the constructor.

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.

3 participants