Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
coldtea
on June 13, 2017
|
parent
|
context
|
favorite
| on:
Learning Node.js and React while building a produc...
>
Yep, we are using arrow functions and other ES2015+ goodies, but they don't help with event handlers.
They do. Just do:
myHandler = (v) => { ... }
and you don't need to bind in the constructor anymore. You'll need to use Babel of course to transpile that.
miroslavpopovic
on June 13, 2017
[–]
Yes, class properties syntax. I mentioned that in the article.
coldtea
on June 13, 2017
|
parent
[–]
Hmm, so why do you say "but they don't help with event handlers"? Because it's not yet standard?
miroslavpopovic
on June 14, 2017
|
root
|
parent
[–]
Sorry, I didn't think about the arrow functions being used in class property syntax too. :) So yes, they do help with event handlers, I stand corrected.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
They do. Just do:
and you don't need to bind in the constructor anymore. You'll need to use Babel of course to transpile that.