From f6696102452e5a4c4c92ce604c09c3305c1730f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Fri, 18 Jul 2025 16:18:03 +0200 Subject: [PATCH] Fix --- .../src/routes/dev/async-rendering.tsx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/example/src/routes/dev/async-rendering.tsx b/packages/example/src/routes/dev/async-rendering.tsx index 7e92581..7b123c9 100644 --- a/packages/example/src/routes/dev/async-rendering.tsx +++ b/packages/example/src/routes/dev/async-rendering.tsx @@ -2,11 +2,12 @@ import { runtime } from "@/runtime" import { Flex, Text, TextField } from "@radix-ui/themes" import { createFileRoute } from "@tanstack/react-router" import { GetRandomValues, makeUuid4 } from "@typed/id" -import { Console, Effect } from "effect" +import { Effect } from "effect" import { Component, Hook } from "effect-fc" import * as React from "react" +// Generator version const RouteComponent = Component.make(function* AsyncRendering() { const VMemoizedAsyncComponent = yield* Component.useFC(MemoizedAsyncComponent) const VAsyncComponent = yield* Component.useFC(AsyncComponent) @@ -27,9 +28,29 @@ const RouteComponent = Component.make(function* AsyncRendering() { Component.withRuntime(runtime.context) ) -const AsyncComponent = Component.make(function* AsyncComponent() { - yield* Console.log("rendering") +// Pipeline version +// const RouteComponent = Component.make("RouteComponent")(() => Effect.Do, +// Effect.bind("VMemoizedAsyncComponent", () => Component.useFC(MemoizedAsyncComponent)), +// Effect.bind("VAsyncComponent", () => Component.useFC(AsyncComponent)), +// Effect.let("input", () => React.useState("")), +// Effect.map(({ input: [input, setInput], VAsyncComponent, VMemoizedAsyncComponent }) => +// +// setInput(e.target.value)} +// /> + +// +// +// +// ), +// ).pipe( +// Component.withRuntime(runtime.context) +// ) + + +const AsyncComponent = Component.make(function* AsyncComponent() { const VSubComponent = yield* Component.useFC(SubComponent) yield* Effect.sleep("500 millis")