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