Effect CommunityEC
Effect Communityβ€’2y agoβ€’
115 replies
steida

Compilation Issue When Migrating from GenericTag to Tag in TypeScript

I have this simple stupid service written with GenericTag
export interface Sqlite {
  readonly exec: (query: SqliteQuery) => Effect.Effect<SqliteExecResult>;
}
export const Sqlite = Context.GenericTag<Sqlite>("@services/Sqlite");

And when I rewrite it to Tag, it does not compile,
export class Sqlite extends Context.Tag("Sqlite")<
  Sqlite,
  { readonly exec: (query: SqliteQuery) => Effect.Effect<SqliteExecResult> }
>() {}

Any idea?
Was this page helpful?