Instance bound class methods
Matthew Robb
matthewwrobb at gmail.com
Mon Jul 13 14:42:11 UTC 2015
Are there any proposals or any discussions around solving the problem of
instance bound class methods with some sugar?
There are examples of people doing things like this:
https://github.com/reactjs/react-future/blob/master/01%20-%20Core/01%20-%20Classes.js#L31
My proposal would be to extend method shorthand syntax to support the arrow:
```
class A extends React.Component {
handleClick(event)=> {
...
}
}
```
Which would be sugar for:
```
class A extends React.Component {
handleClick = (event)=> {
...
}
}
```
- Matthew Robb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150713/82e4d49f/attachment.html>
More information about the es-discuss
mailing list