From 4913f5cc35af7ca91afefae2d504e15f6a9a36c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Mon, 30 Jun 2025 22:07:38 +0200 Subject: [PATCH] Tests --- packages/example/src/routes/effect-component-tests.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/example/src/routes/effect-component-tests.tsx b/packages/example/src/routes/effect-component-tests.tsx index 055ff33..51c5057 100644 --- a/packages/example/src/routes/effect-component-tests.tsx +++ b/packages/example/src/routes/effect-component-tests.tsx @@ -5,11 +5,19 @@ import { ReactComponent, ReactHook, ReactManagedRuntime } from "effect-component import * as React from "react" +const LogLive = Layer.scopedDiscard(Effect.acquireRelease( + Console.log("Runtime built."), + () => Console.log("Runtime destroyed."), +)) + class TestService extends Effect.Service()("TestService", { effect: Effect.bind(Effect.Do, "ref", () => SubscriptionRef.make("value")), }) {} -const runtime = ReactManagedRuntime.make(Layer.empty) +const runtime = ReactManagedRuntime.make(Layer.empty.pipe( + Layer.provideMerge(LogLive), + Layer.provideMerge(TestService.Default), +)) export const Route = createFileRoute("/effect-component-tests")({