Get currently destructured object

Caitlin Potter caitpotter88 at gmail.com
Thu May 19 22:46:28 UTC 2016


Pedantic nitpick for no reason: NamedSpecifiers of an ImportDeclaration are different from “destructuring”, conflating the two is likely to confuse people =)

> On May 19, 2016, at 11:59 AM, Michał Wadas <michalwadas at gmail.com> wrote:
> 
> Idea:
> 
> function foo({bar, *: baz}) {
> 
> }
> 
> would be equivalent to:
> 
> function foo(baz) {
>    const bar =  baz.bar;
> }
> 
> Rationales:
> - little better IDE support (argument name reveals intention)
> - allows to write more concise code when handling case of getting common values and handling whole object optionally
> - improve pattern "use few properties of options object then pass it deeper"
> - allows more expressive module import
> - allows to more concise code when destructuring expression result
> 
> import {*: rand, generateRandomInt} from 'fancy-random-module';
> import {*: moment, isMoment} from 'moment';
> 
> _______________________________________________
> 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/20160519/5cf11ca6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160519/5cf11ca6/attachment.sig>


More information about the es-discuss mailing list