This commit is contained in:
Julien Valverdé
2024-07-03 14:27:36 +02:00
parent f7be8eb40b
commit 00299615d6
2 changed files with 7 additions and 25 deletions

View File

@@ -23,33 +23,13 @@ export const TRPCEffectRuntimeLive = Layer.effect(TRPCEffectRuntime,
export const t = initTRPC.create() export const t = initTRPC.create()
// export const run = <
// Args extends unknown[],
// A, E, R
// >(
// program: (...args: Args) => Effect.Effect<A, E, R>
// ) => FiberSet.makeRuntime<R>().pipe(
// Effect.map(runFork =>
// (...args: Args) => runFork(program(...args))
// )
// )
const testRouter = Effect.gen(function*() { const testRouter = Effect.gen(function*() {
const run = yield* TRPCEffectRuntime const run = yield* TRPCEffectRuntime
return t.router({ return t.router({
// test1: t.procedure.query( test1: t.procedure.query(() => run(Effect.gen(function*() {
// yield* run((opts) => Effect.gen(function*() {
// const todos = yield* TodoRepository
// return "test"
// }))
// ),
test1: t.procedure.query(
(opts) => run(Effect.gen(function*() {
const todos = yield* TodoRepository const todos = yield* TodoRepository
return "test" return "test"
})) }))),
),
}) })
}) })

View File

@@ -19,4 +19,6 @@ export const ServerLive = Layer.scopedDiscard(Effect.gen(function*() {
server.close() server.close()
), ),
) )
})) })).pipe(
Layer.provide(ExpressLive)
)