ES modules take: I'm pretty sure if you use `export default` you'll regret it.
-
-
-
Replying to @wycats
named exports are better.
you can have several of them
they encourage consistent naming throughout an application
they work better with `export *`
mixed default and named imports are cumbersome and ugly1 reply 0 retweets 0 likes -
Replying to @chriseppstein @wycats
After 8 months of writing ES module code, I've just found that an export default eventually ends up annoying me; better to just start with a module that exports a single name.
1 reply 0 retweets 0 likes -
Replying to @chriseppstein
Are you mostly writing app code or lib code? Mostly small packages or large ones?
1 reply 0 retweets 0 likes -
Replying to @wycats
mostly lib code. how do you define a "small package"?
1 reply 0 retweets 0 likes -
Replying to @chriseppstein
Something like mkdirp (with one main export and a handful of clearly subordinate exports) is a small package. Anything bigger is a large one.
1 reply 0 retweets 0 likes -
I think for large libraries I completely buy the idea that you shouldn't use default export. For libraries like mkdirp it captures what was nice about single export. For app code being able to export default a component is nice (look at an ember app, not better w/o default)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.