Effect CommunityEC
Effect Community2y ago
36 replies
Stephen Bluck

Making Data.TaggedEnum Opaque in TypeScript

Is there a way to get Data.TaggedEnum to be opaque (not sure if this is the right term)? Basically I want to see RequestSession in the type signature and not each union member:
export type RequestSession = Data.TaggedEnum<{
  NotProvided: {};
  Provided: { session: Session<User> };
  Set: { session: Session<User> };
  Unset: {};
  InvalidToken: {};
}>;
Screenshot_2024-03-03_at_18.19.46.png
Was this page helpful?