Module syntax

Rick Waldron waldron.rick at gmail.com
Mon Jun 3 11:41:58 PDT 2013


On Mon, Jun 3, 2013 at 2:40 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> On Mon, Jun 3, 2013 at 1:29 PM, Axel Rauschmayer <axel at rauschma.de> wrote:
>
>> Bikeshedding: I generally like the module syntax, but I’d always omit the
>> braces and use `import default` for importing the default export of a
>> module.
>>
>
> From the wiki:
>
> module "foo" {
>   export default function() { console.log("hello!") }
> }
> ...
> import default;
>
> What would be the bound name? foo? Am I missing something?
>
>
> I’d use:
> import default foo from "foo";
>

How is this better then the existing:

  import foo from "foo";

For importing a default export?

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130603/ddf3d99d/attachment-0001.html>


More information about the es-discuss mailing list