ModuleImport

C. Scott Ananian ecmascript at cscott.net
Wed Jun 25 12:52:50 PDT 2014


On Wed, Jun 25, 2014 at 2:59 PM, Kevin Smith <zenparsing at gmail.com> wrote:

> Correct me if I'm wrong, but the perspective says: "why would I need to
> import the multiple-exports if I'm specifically overriding the exports with
> a default?  Having a way to import both the default and multiple-exports is
> silly and confusing."
>

For my part, my personal perspective is, "I have a module named `foo`.  I
want to write `foo.bar` to get the export named bar.  I don't care *what*
`foo` is.  Perhaps its a function object for backwards-compatibility.
 Perhaps it's a module object because of some circular dependency.  Perhaps
it's a plain object.  To me it's just a namespace.  Please let me use the
same import syntax regardless.  In exchange, I promise never to use bare
`foo` in my code."

There are a couple of different solutions; default-default is one of those.
 --scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140625/108bcddd/attachment.html>


More information about the es-discuss mailing list