createRegistry API
Foundation for ordered, keyed collections. Items are registered with IDs and indexes, and can be looked up by ID, index, or value.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createRegistry | Registration |
| useProxyRegistry | Reactivity |
| createSelection | Selection |
| createTokens | Registration |
| createForm | Forms |
Functions
createRegistry
(options?: RegistryOptions | undefined) => RegistryContext<Z, E>Creates a new registry instance.
createRegistryContext
(_options?: RegistryContextOptions) => ContextTrinity<RegistryContext<Z, E>>Creates a new registry context.
Options
Properties
Methods
seek
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => E | undefinedSeek for a ticket based on direction and optional predicate
on
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidListen for registry events
off
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidStop listening for registry events
emit
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => voidEmit an event with data
offboard
(ids: ID[]) => Partial<Z>[]Offboard multiple tickets at once, returning the input shapes that were removed.
batch
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete