diff --git a/packages/effect-fc/src/Hook.ts b/packages/effect-fc/src/Hook.ts index 3977afe..de45e88 100644 --- a/packages/effect-fc/src/Hook.ts +++ b/packages/effect-fc/src/Hook.ts @@ -19,7 +19,7 @@ export const useScope: { const [isInitialRun, initialScope] = React.useMemo(() => Runtime.runSync(runtime)(Effect.all([ Ref.make(true), - Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.parallel), + Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.sequential), ])), []) const [scope, setScope] = React.useState(initialScope) @@ -30,7 +30,7 @@ export const useScope: { () => closeScope(scope, runtime, options), ), - onFalse: () => Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.parallel).pipe( + onFalse: () => Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.sequential).pipe( Effect.tap(scope => Effect.sync(() => setScope(scope))), Effect.map(scope => () => closeScope(scope, runtime, options)), ),