Y
Hacker News
new
|
ask
|
show
|
jobs
by
nightski
2724 days ago
My only complaint is having to manually bind methods in the constructor. I understand why it's necessary but it is tedious. I suppose the answer is to just use TypeScript but we are talking about ES6 here.
2 comments
seekbeak
2723 days ago
Can't the majority of that manual binding be done by good 'ol fat arrows?
link
matthewmacleod
2723 days ago
Have you looked at using arrow functions in class properties for this? They have some issues, but avoid all the tedious manual binding.
Alternatively, the autobind decorator could help - though I’ve never used that myself.
link
LiquidFlux
2723 days ago
I've used Autobind a great deal as of recent with React classes, it's been both pleasant to use and I've yet to experience any issues with it.
link