This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user