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

This commit is contained in:
Julien Valverdé
2025-07-08 00:36:42 +02:00
parent e3dd2975fe
commit 802297626c
2 changed files with 11 additions and 3 deletions

View File

@@ -10,8 +10,16 @@ const TodosStateLive = TodosState.Default("todos")
export const Route = createFileRoute("/")({
component: Component.make(function* Index() {
const context = yield* Hook.useContextSync(TodosStateLive, { finalizerExecutionMode: "fork" })
const context = yield* Hook.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })
return yield* Effect.provide(Component.use(Todos, Todos => <Todos />), context)
// const context = yield* Hook.useContextAsync(TodosStateLive)
// return yield* AsyncData.match(context, {
// NoData: () => Effect.succeed(<Text>No data.</Text>),
// Loading: () => Effect.succeed(<Text>Loading...</Text>),
// Failure: () => Effect.succeed(<Text>Failed.</Text>),
// Success: context => Effect.provide(Component.use(Todos, Todos => <Todos />), context),
// })
}).pipe(
Component.withRuntime(runtime.context)
)