diff --git a/src/TRPC/TRPCContextCreator.ts b/src/TRPC/TRPCContextCreator.ts index 49425c2..9087b1e 100644 --- a/src/TRPC/TRPCContextCreator.ts +++ b/src/TRPC/TRPCContextCreator.ts @@ -5,21 +5,21 @@ import { createTRCPErrorMapper } from "./createTRCPErrorMapper" import { TRPCContextTransactionEnum, type TRPCContext, type TRPCContextTransaction } from "./TRPCContext" +export const Identifier = "@thilalib/TRPC/TRPCContextCreator" + +export interface TRPCContextCreator extends Context.Tag> {} + export interface TRPCContextCreatorService { readonly createContext: (transaction: TRPCContextTransaction) => TRPCContext readonly createExpressContext: (context: CreateExpressContextOptions) => TRPCContext readonly createWebSocketContext: (context: CreateWSSContextFnOptions) => TRPCContext } -export class TRPCUnknownContextCreator extends Context.Tag("@thilalib/TRPC/TRPCContextCreator") ->() {} +export const TRPCUnknownContextCreator = Context.GenericTag>(Identifier) export const make = () => { - class TRPCContextCreator extends Context.Tag("@thilalib/TRPC/TRPCContextCreator") - >() {} + const TRPCContextCreator = Context.GenericTag>(Identifier) const TRPCContextCreatorLive = Layer.effect(TRPCContextCreator, Effect.gen(function*() { const runtime = yield* Effect.runtime() @@ -53,5 +53,5 @@ export const make = () => { return { createContext, createExpressContext, createWebSocketContext } })) - return { TRPCContextCreator, TRPCContextCreatorLive } + return { TRPCContextCreator, TRPCContextCreatorLive } as const }