From f079b90f287c17908ef6e3892afcf0db1232678c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Tue, 1 Jul 2025 16:48:53 +0200 Subject: [PATCH] Tests --- .../example/src/routes/effect-component-tests.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/example/src/routes/effect-component-tests.tsx b/packages/example/src/routes/effect-component-tests.tsx index e878655..96a868a 100644 --- a/packages/example/src/routes/effect-component-tests.tsx +++ b/packages/example/src/routes/effect-component-tests.tsx @@ -1,6 +1,6 @@ import { Box, TextField } from "@radix-ui/themes" import { createFileRoute } from "@tanstack/react-router" -import { Console, Effect, Layer, pipe, Ref, Runtime, SubscriptionRef } from "effect" +import { Array, Console, Effect, Layer, pipe, Ref, Runtime, SubscriptionRef } from "effect" import { ReactComponent, ReactHook, ReactManagedRuntime } from "effect-components" @@ -42,6 +42,11 @@ const MyRoute = pipe( const service = yield* TestService const [value] = yield* ReactHook.useSubscribeRefs(service.ref) + const MyTestComponentFC = yield* Effect.provide( + ReactComponent.useFC(MyTestComponent), + yield* ReactHook.useMemoLayer(SubService.Default), + ) + return <> - {yield* ReactComponent.use(MyTestComponent, C => ).pipe( + {/* {yield* ReactComponent.use(MyTestComponent, C => ).pipe( Effect.provide(yield* ReactHook.useMemoLayer(SubService.Default)) + )} */} + + {Array.range(0, 3).map(k => + )} }),