TRPCContextCreator
This commit is contained in:
@@ -7,12 +7,12 @@ import type { TRPCContext } from "./TRPCContext"
|
||||
/**
|
||||
* Provides a function that instantiates a fresh context for each tRPC procedure call
|
||||
*/
|
||||
export class CreateTRPCContext extends Context.Tag("CreateTRPCContext")<CreateTRPCContext,
|
||||
export class TRPCContextCreator extends Context.Tag("TRPCContextCreator")<TRPCContextCreator,
|
||||
(opts: CreateExpressContextOptions) => TRPCContext
|
||||
>() {}
|
||||
|
||||
export module CreateTRPCContext {
|
||||
export const Live = Layer.effect(CreateTRPCContext, Effect.gen(function*() {
|
||||
export module TRPCContextCreator {
|
||||
export const Live = Layer.effect(TRPCContextCreator, Effect.gen(function*() {
|
||||
const run = yield* Effect.runtime<Services>().pipe(
|
||||
Effect.map(Runtime.runFork)
|
||||
)
|
||||
Reference in New Issue
Block a user