4 ms·
>Yep, we are using arrow functions and other ES2015+ goodies, but they don't help with event handlers. They do. Just do: myHandler = (v) => { ... } a
by coldtea 9y ago
>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 9y agoYes, class properties syntax. I mentioned that in the article.
- coldtea 9y agoHmm, so why do you say "but they don't help with event handlers"? Because it's not yet standard?
- miroslavpopovic 9y agoSorry, 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.