In the ~maybe long~ future , after the current decorators proposal
[1], we can start thinking about a Method Parameter Decorator (already
proposed [2]), we could do something like:
``` js
class Foo {
constructor(@field foo) {
}
}
```
In my opinion, it would be a much more powerful approach
Em qua, 28 de nov de 2018 às 16:33, Simo Costa
<[email protected]> escreveu:
>
> In costructor functions and in the constructor() method in ES6 classes is
> easily to fall in the following pattern:
>
> F(par1, par2, ..., parN) {
> this.par1 = par1;
> this.par2 = par2;
> ...
> this.parN = parN;
> }
>
>
> So my proposal is to avoid those repetitions by prefixing a dot . to each
> parameter:
>
> F(.par1, .par2, ..., .parN) {}
>
> Simple but quite useful. More info here:
> https://github.com/jfet97/proposal-fast-this-assignments
>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
--
Atenciosamente,
Augusto Borges de Moura
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss