Extensible destructuring proposal

Samuel Hapák samuel.hapak at vacuumapps.com
Tue Jul 21 06:14:19 UTC 2015


Hello there,

I have written proposal to allow extend standard behavior of object destructuring:
https://github.com/vacuumlabs/es-proposals/blob/master/extensible-destructuring.md

Main idea is, that currently object destructuring is useless for people who use Map or Immutable.Map (https://facebook.github.io/immutable-js/) as their main data structure.

This would allow authors of libraries to create map like structures that would support destructuring. It extends the language in a similar way iterator does.

The main idea is, that if object defines `Symbol.get` method, it gets used to access properties of object instead of `[]` when destructuring.

What do you think?

Cheers,

Samuel






-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3589 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150721/a1118b02/attachment.p7s>


More information about the es-discuss mailing list