You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like something that should be proposed to TC39 first, as this directly affects the ECMAScript syntax.
I have been interested in extending more of the ECMAScript module syntax to namespaces, but that's been fairly low on the list of priorities. If we did that however, you might be able to do something like this:
This seems like something that should be proposed to TC39 first, as this directly affects the ECMAScript syntax.
I have been interested in extending more of the ECMAScript module syntax to namespaces, but that's been fairly low on the list of priorities. If we did that however, you might be able to do something like this:
I have needed and wanted this syntax dozens of times. Specifically, namespace/function/type merging is useful for representing things like a type User, component function User, and namespace User (i.e. User.someFunction).
It's extremely hard currently to re-export something like User.Profile if Profile exists outside of the namespace definition itself.
Activity
RyanCavanaugh commentedon Apr 20, 2020
Ron Buckton (@rbuckton) thoughts?
rbuckton commentedon Apr 20, 2020
This seems like something that should be proposed to TC39 first, as this directly affects the ECMAScript syntax.
I have been interested in extending more of the ECMAScript module syntax to namespaces, but that's been fairly low on the list of priorities. If we did that however, you might be able to do something like this:
DanielRosenwasser commentedon Apr 22, 2020
If all you're interested in is exporting values, you could also write
cruhl commentedon Jul 21, 2020
I have needed and wanted this syntax dozens of times. Specifically, namespace/function/type merging is useful for representing things like a
type User, componentfunction User, andnamespace User(i.e.User.someFunction).It's extremely hard currently to re-export something like
User.ProfileifProfileexists outside of the namespace definition itself.