Import All Named Exports into One Variable
stringUtils can reference any exports in
string-utils.mjs using property access syntax.
Importing all named exports into a single variable is great feature for application code.
Consider these UI modules that have a similar export signatur.
Renaming all of these named exports is super irritating!
By reducing moduling imports to a single reference, we eliminate the need to rename the colliding exports.
And these namespaces guarantee that we never experience a collision between named exports.
This is my preferred way to import named exports. It has eliminated pointless hours spent justifying local references between modules I don’t control.
This is part of a course I’m build on modules at lunch.dev.
When live, members get access to this and other courses on React.