Make nonReactiveTags a Component option
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2026-03-10 20:48:31 +01:00
parent c644f8c44b
commit 0ba00a0b4f

View File

@@ -88,7 +88,7 @@ const use = Effect.fnUntraced(function* <P extends {}, A extends React.ReactNode
}),
Equivalence.array(Equivalence.strict()),
)))[0](Array.from(
Context.omit(...nonReactiveTags)(runtimeRef.current.context).unsafeMap.values()
Context.omit(...self.nonReactiveTags ?? [])(runtimeRef.current.context).unsafeMap.values()
))
})
@@ -96,10 +96,11 @@ const use = Effect.fnUntraced(function* <P extends {}, A extends React.ReactNode
export interface ComponentOptions {
/**
* Custom display name for the component in React DevTools and debugging utilities.
* Improves developer experience by providing meaningful component identification.
*/
readonly displayName?: string
readonly nonReactiveTags?: readonly Context.Tag<any, any>[]
/**
* Specifies the execution strategy for finalizers when the component unmounts or its scope closes.
* Determines whether finalizers execute sequentially or in parallel.
@@ -119,14 +120,12 @@ export interface ComponentOptions {
}
export const defaultOptions: ComponentOptions = {
nonReactiveTags: [Tracer.ParentSpan],
finalizerExecutionStrategy: ExecutionStrategy.sequential,
finalizerExecutionDebounce: "100 millis",
}
export const nonReactiveTags = [Tracer.ParentSpan] as const
export const isComponent = (u: unknown): u is Component<{}, React.ReactNode, unknown, unknown> => Predicate.hasProperty(u, ComponentTypeId)
export declare namespace make {