>
>
> That said, it requires no more code to say:
>
>    // jquery.js
>    export function $(selector) { ... }
>    ...
>
>    // client
>    import $ from "jquery.js";
>
>    let elements = ["foo", "bar", "baz"].map($);
>    $("quux").style(...);
>
> So maybe people have over-sold the importance of callable modules. In
> CommonJS + ES5, it's convenient because there's no way to avoid binding a
> name to the module. Whereas if you have destructuring and destructuring
> import, a module with a single export does not need to be any less
> convenient than a module that is itself the single export.
>
> Thoughts?
>

Yeah, I think you hit the nail on the head, there. With the destructuring
import, callable modules is pointless complexity. It stays simple and
intuitive IMO.

- Russ


>
> Dave
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to