Re: Re: Proposal For A New Alternative Keyword To “this” For Classes
robjtede at icloud.com
Mon Mar 11 13:57:24 UTC 2019
I would imagine that this can be achieved with bind operator proposal, which already has Babel support, despite no examples showing usage inside a class.
seems to be the syntax that will de-sugar to
to get you the desired this binding.
I’m surprised this idea hasn't been mentioned yet although things have been moving slowly on that proposal and it seems to need some community support to move along.
1: Bind Syntax Proposal (https://github.com/tc39/proposal-bind-operator <https://github.com/tc39/proposal-bind-operator>)
2: Babel Plugin (https://babeljs.io/docs/en/next/babel-plugin-proposal-function-bind <https://babeljs.io/docs/en/next/babel-plugin-proposal-function-bind>)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss