Fix
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { Effect, Runtime } from "effect"
|
||||
import type { RuntimeFiber } from "effect/Fiber"
|
||||
import type { Effect } from "effect"
|
||||
import type { Request } from "express"
|
||||
import type { Services } from "../Services"
|
||||
|
||||
@@ -7,7 +6,7 @@ import type { Services } from "../Services"
|
||||
export interface TRPCContext {
|
||||
req: Request
|
||||
run: <A, E>(
|
||||
self: Effect.Effect<A, E, Services>,
|
||||
options?: Runtime.RunForkOptions,
|
||||
) => RuntimeFiber<A, E>
|
||||
effect: Effect.Effect<A, E, Services>,
|
||||
options?: { readonly signal?: AbortSignal }
|
||||
) => Promise<A>
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export class TRPCContextCreator extends Context.Tag("TRPCContextCreator")<TRPCCo
|
||||
export module TRPCContextCreator {
|
||||
export const Live = Layer.effect(TRPCContextCreator, Effect.gen(function*() {
|
||||
const run = yield* Effect.runtime<Services>().pipe(
|
||||
Effect.map(Runtime.runFork)
|
||||
Effect.map(Runtime.runPromise)
|
||||
)
|
||||
|
||||
return ({ req }) => ({
|
||||
|
||||
Reference in New Issue
Block a user