On 26 June 2012 16:45, Kevin Smith <[email protected]> wrote:
> Hi Isaac,
>
> I share some of your concerns as well. I like the idea of "import" just
> returning an object, which can be destructured using let. I also like the
> idea of eliminating the "import *" syntax. However, I think that dynamic
> exports ("export <expression>") might not be as useful as it seems.
>
> In my modules, I use the "export <expression>" form for the following
> reasons:
>
> 1. When I want to export a single function (perhaps a constructor), and I
> don't want importers to unnecessarily repeat the function name:
>
> var MyClass = require("MyClass").MyClass; // Boo!
> var MyClass = require("MyClass"); // Better!
>
var { MyClass } = require("MyClass"); // Best!
Best of both worlds! My code is full of this.
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss