Get currently destructured object

Michał Wadas michalwadas at gmail.com
Thu May 19 15:59:21 UTC 2016


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';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160519/edcb72eb/attachment.html>


More information about the es-discuss mailing list