Skip to content

API ReferenceAdvanced utilities and typesType Alias

ContextualSource\<T, TContext\>

type ContextualSource<T, TContext> = T | null | ((context) => T | null | Promise<T | null>);

A value that can be supplied directly, deliberately disabled with null, or derived from the operation context when it is needed.

undefined is intentionally not part of this type. At component/provider boundaries it means “inherit the next source”; once a source is selected, only a value or explicit null is a valid result.

Type Parameters

Type Parameter
T
TContext