registryComponent
registryComponent<
TValue,TId,TValueKey>(name,options):ComponentDef<RegistryComponentValue<TValue,TValueKey>>
Defined in: src/component-store.ts:560
Build a ComponentDef for registry-backed references.
The generated serializer stores only an id field (default: { id }),
and deserializer resolves that id through a supplied lookup function,
returning a single-field object (default: { def }).
Type Parameters
Section titled “Type Parameters”TValue
Section titled “TValue”TValue
TId extends string | number
TValueKey
Section titled “TValueKey”TValueKey extends string = "def"
Parameters
Section titled “Parameters”string
options
Section titled “options”RegistryComponentOptions<TValue, TId, TValueKey>
Returns
Section titled “Returns”ComponentDef<RegistryComponentValue<TValue, TValueKey>>
Example
Section titled “Example”interface Card { def: CardDef }const CardDefComp = registryComponent<CardDef, string>('card', { lookup: getCardDef, selectId: def => def.id,});