-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[todos] [refactor] improve the general style of the approach to React #2852
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
Conversation
| {filter.label} | ||
| </FilterLink> | ||
| ))} | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is pedantic, but can we leave this alone? I'd rather make the UI and code 1:1, than essentially be doing meta-programming of the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wondering about this as well. Amended my last commit, should be restored now.
|
BTW, any code changes here need to be reflected here: https://github.com/reactjs/redux/blob/master/docs/basics/ExampleTodoList.md |
3766a49 to
c6fb75c
Compare
|
Seems like the |
a589d68 to
51af07b
Compare
examples/todos/src/actions/index.js
Outdated
| SHOW_ACTIVE: 'SHOW_ACTIVE' | ||
| SHOW_ALL: 'SHOW_ALL', | ||
| SHOW_COMPLETED: 'SHOW_COMPLETED', | ||
| SHOW_ACTIVE: 'SHOW_ACTIVE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still be two spaces. Are you running Prettier locally? We've added it to the library code, but not the examples yet. It may be a good idea to introduce it now, since this is already a pretty notable refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Not sure how that happened, I'm not using Prettier locally either. Maybe consider creating a issue about it separately and it might get taken up in another pull request. Fixed it for now.
timdorr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
51af07b to
ecf091f
Compare
|
@timdorr This should be ready for merging now. |
|
It's got the 👍 from me, but since this is rather large and very visible code, I'd like a second set of eyes on it before merging. |
|
Hi @timdorr! About the coding style, I think the changes made by @raunofreiberg are for the better. It uses const declarations instead of let, has better naming conventions and the arrow functions implicitly return objects. The refactoring (in my opinion) does improves readability. |
|
OK, I think we're good on this. Thanks! |
Some code clean-up for easier understanding and better conventions (i.e no temporary variable for connecting a component to the store).