Effect CommunityEC
Effect Community3y ago
13 replies
Stephen Bluck

Optimizing File Structure for Effective Namespacing

What is the best way to structure files so we can have good namespacing?

I have two files User.ts and Session.ts and an index.ts that re-exports like so:
export * as User from './User';
export * as Session from './Session';

The problem is I have the annoying repetition of User.User and Session.Session - it gets even more out of control when I have to combine them like:
type UserSession = Session.Session<User.User>

The namespacing is good when it comes to other things in the file like:
Session.make(...)
User.Schema
//...etc

Is there anything better that can done?
Was this page helpful?