Instance bound class methods
Bucaran
jbucaran at me.com
Mon Jul 13 14:44:08 UTC 2015
This and arrow generators would be a nice thing to have.
> On Jul 13, 2015, at 11:42 PM, Matthew Robb <matthewwrobb at gmail.com> wrote:
>
> 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 <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
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150713/39f86f6d/attachment.html>
More information about the es-discuss
mailing list