@@ -3,18 +3,18 @@ import { Todos } from "@/todo/Todos"
|
||||
import { TodosState } from "@/todo/TodosState.service"
|
||||
import { createFileRoute } from "@tanstack/react-router"
|
||||
import { Effect } from "effect"
|
||||
import { ReactComponent, ReactHook } from "effect-fc"
|
||||
import { Component, Hook } from "effect-fc"
|
||||
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: ReactComponent.make(function* Index() {
|
||||
component: Component.make(function* Index() {
|
||||
return yield* Effect.provide(
|
||||
ReactComponent.use(Todos, Todos => <Todos />),
|
||||
yield* ReactHook.useMemoLayer(TodosState.Default("todos")),
|
||||
Component.use(Todos, Todos => <Todos />),
|
||||
yield* Hook.useMemoLayer(TodosState.Default("todos")),
|
||||
)
|
||||
}, {
|
||||
finalizerExecutionMode: "fork"
|
||||
}).pipe(
|
||||
ReactComponent.withRuntime(runtime.context),
|
||||
Component.withRuntime(runtime.context),
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user