Default exports, without explicit syntactic support
Axel Rauschmayer
axel at rauschma.de
Thu Jun 26 07:39:53 PDT 2014
> // my-class.js
> export class MyClass {
> constructor() { ... }
> method() { ... }
> }
>
> // use-class.js
> import { MyClass } from "my-class.js";
You do have redundancy in `my-class.js` and, as Marius pointed out, the importer has to know both the name of the module and the name of the entity inside the module. Not that big of a deal. Again, standardizing on `_` for default exports helps, but then importing is more verbose:
// my-class.js
export class _ {
constructor() { ... }
method() { ... }
}
// use-class.js
import { _ as MyClass } from "my-class.js";
--
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140626/87532102/attachment.html>
More information about the es-discuss
mailing list