From 30563bfc2f0be1249c08418956516d74d3679699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Mon, 7 Jul 2025 19:03:50 +0200 Subject: [PATCH] Fix --- packages/effect-fc/src/Hook.ts | 7 +++++-- packages/example/src/routes/index.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/effect-fc/src/Hook.ts b/packages/effect-fc/src/Hook.ts index de45e88..b9fc28d 100644 --- a/packages/effect-fc/src/Hook.ts +++ b/packages/effect-fc/src/Hook.ts @@ -167,10 +167,13 @@ export const useFork: { React.useEffect(() => { const scope = Runtime.runSync(runtime)(options?.scope ? Scope.fork(options.scope, options?.finalizerExecutionStrategy ?? ExecutionStrategy.sequential) - : Scope.make(options?.finalizerExecutionStrategy) + : Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.sequential) ) Runtime.runFork(runtime)(Effect.provideService(effect(), Scope.Scope, scope), { ...options, scope }) - return () => closeScope(scope, runtime, options) + return () => closeScope(scope, runtime, { + ...options, + finalizerExecutionMode: options?.finalizerExecutionMode ?? "fork", + }) }, deps) }) diff --git a/packages/example/src/routes/index.tsx b/packages/example/src/routes/index.tsx index 2baf5e4..447cd62 100644 --- a/packages/example/src/routes/index.tsx +++ b/packages/example/src/routes/index.tsx @@ -13,6 +13,6 @@ export const Route = createFileRoute("/")({ const context = yield* Hook.useContextSync(TodosStateLive, { finalizerExecutionMode: "fork" }) return yield* Effect.provide(Component.use(Todos, Todos => ), context) }).pipe( - Component.withRuntime(runtime.context), + Component.withRuntime(runtime.context) ) })