0.1.2 (#3)
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com> Reviewed-on: https://gitea:3000/Thilawyn/effect-fc/pulls/3
This commit was merged in pull request #3.
This commit is contained in:
@@ -10,16 +10,11 @@ const TodosStateLive = TodosState.Default("todos")
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: Component.make(function* Index() {
|
||||
const context = yield* Hook.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })
|
||||
return yield* Effect.provide(Component.use(Todos, Todos => <Todos />), context)
|
||||
return yield* Todos.pipe(
|
||||
Effect.map(FC => <FC />),
|
||||
Effect.provide(yield* Hook.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })),
|
||||
)
|
||||
}).pipe(
|
||||
Component.withRuntime(runtime.context)
|
||||
)
|
||||
|
||||
// component: Component.make("Index")(
|
||||
// () => Hook.useContext(TodosStateLive, { finalizerExecutionMode: "fork" }),
|
||||
// Effect.andThen(context => Effect.provide(Component.use(Todos, Todos => <Todos />), context)),
|
||||
// ).pipe(
|
||||
// Component.withRuntime(runtime.context)
|
||||
// )
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user