Skip to content

Conversation

@tonyspiro
Copy link
Contributor

No description provided.

dispatch(addTodo(input.value))
<form onSubmit={e => {
e.preventDefault()
if(input.value.trim())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style:

        if (input.value.trim()) {
          dispatch(addTodo(input.value))
        }

@gaearon
Copy link
Contributor

gaearon commented Feb 15, 2016

What is the benefit of this? Does this make Enter work?

@tonyspiro
Copy link
Contributor Author

Yes it makes enter work as well as the submit button click.

dispatch(addTodo(input.value))
<form onSubmit={e => {
e.preventDefault()
if (input.value.trim()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this an early return instead.

@gaearon
Copy link
Contributor

gaearon commented Feb 15, 2016

Can you please apply the same change to all other examples in docs and examples folder? I think these lines should have a couple more matches across the codebase.

@tonyspiro
Copy link
Contributor Author

@gaearon will do 👍

@tonyspiro
Copy link
Contributor Author

@gaearon this should be good to go. Please let me know if I missed anything.

gaearon added a commit that referenced this pull request Feb 16, 2016
@gaearon gaearon merged commit 8167084 into reduxjs:master Feb 16, 2016
@gaearon
Copy link
Contributor

gaearon commented Feb 16, 2016

Thank you!

@tonyspiro
Copy link
Contributor Author

np 😄 thank you!

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