0.1.13 #18

Merged
Thilawyn merged 359 commits from next into master 2025-06-18 00:12:19 +02:00
Showing only changes of commit cf6c84ff8e - Show all commits

View File

@@ -14,7 +14,7 @@ export interface ScopeOptions {
readonly finalizerExecutionStrategy?: ExecutionStrategy.ExecutionStrategy readonly finalizerExecutionStrategy?: ExecutionStrategy.ExecutionStrategy
} }
export interface UseScopeOptions extends ScopeOptions { export interface UseScopeOptions extends RenderOptions, ScopeOptions {
readonly finalizerExecutionMode?: "sync" | "fork" readonly finalizerExecutionMode?: "sync" | "fork"
} }
@@ -102,7 +102,7 @@ export abstract class ReffuseNamespace<R> {
const [isInitialRun, initialScope] = React.useMemo(() => runSync(Effect.all([ const [isInitialRun, initialScope] = React.useMemo(() => runSync(Effect.all([
Ref.make(true), Ref.make(true),
Scope.make(options?.finalizerExecutionStrategy), Scope.make(options?.finalizerExecutionStrategy ?? ExecutionStrategy.sequential),
])), []) ])), [])
const [scope, setScope] = React.useState(initialScope) const [scope, setScope] = React.useState(initialScope)
@@ -133,7 +133,10 @@ export abstract class ReffuseNamespace<R> {
}), }),
runSync, runSync,
), [runSync, runFork, ...deps]) ), [
...options?.doNotReExecuteOnRuntimeOrContextChange ? [] : [runSync, runFork],
...deps,
])
return scope return scope
} }