Scope refactoring
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2025-07-07 05:46:43 +02:00
parent 708c93ed83
commit 1f541b4234
3 changed files with 88 additions and 107 deletions

View File

@@ -10,12 +10,8 @@ const TodosStateLive = TodosState.Default("todos")
export const Route = createFileRoute("/")({
component: Component.make(function* Index() {
return yield* Effect.provide(
Component.use(Todos, Todos => <Todos />),
yield* Hook.useMemoLayer(TodosStateLive),
)
}, {
finalizerExecutionMode: "fork"
const context = yield* Hook.useContextSync(TodosStateLive, { finalizerExecutionMode: "fork" })
return yield* Effect.provide(Component.use(Todos, Todos => <Todos />), context)
}).pipe(
Component.withRuntime(runtime.context),
)