Exporting Symbols
Francisco Tolmasky
tolmasky at gmail.com
Thu Oct 15 07:14:59 UTC 2015
Not sure if it isn’t the case, but it seems the only way to export symbols
right now is:
```js
export default { [Symbol(“something”)]: blah }
```
It would be nice if “symbol literals” could somehow be supported. In
particular, I can imagine this sort of thing becoming common:
export { “5.4” as Symbol(“version”) }
Or, even better (but harder since its now more expression):
import VersionSymbol from “symbols"
export { “5.4” as VersionSymbol }
I’m currently writing an API where there are expected methods stored in
symbols, but this forces exporting one default object instead of being able
to lay them out individual.
Thanks,
Francisco
--
Francisco Tolmasky
www.tolmasky.com
tolmasky at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151015/58d339ce/attachment.html>
More information about the es-discuss
mailing list