createRegistry
A foundational composable for building registration-based systems, managing collections of registered items with automatic indexing, and lifecycle management.
Usage
The createRegistry composable provides a powerful interface for managing collections of items in a registration-based system. It allows you to register, unregister, and look up items efficiently, while maintaining an index for quick access.
import { createRegistry } from '@vuetify/v0'
const registry = createRegistry()
const ticket1 = registry.register()
const ticket2 = registry.register()
const ticket3 = registry.register()
console.log(registry.size) // 3Architecture
createRegistry is the foundation for specialized registration systems:
Each branch extends the base ticket pattern with domain-specific capabilities. See individual composable docs for their extension hierarchies.
Reactivity
createRegistry uses minimal reactivity by default for performance. Collection methods are not reactive unless you opt in.
Need reactive collections? Wrap with useProxyRegistry(registry) for full template reactivity, or pass reactive: true when creating the registry.
Functions
createRegistryContext
(_options?: RegistryContextOptions) => ContextTrinity<E>Creates a new registry context.
Options
Properties
Methods
seek
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => Z | undefinedSeek for a ticket based on direction and optional predicate
on
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => voidListen for registry events
off
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => voidStop listening for registry events
emit
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<Z, K>) => voidEmit an event with data
batch
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete
Benchmarks
Every operation is profiled across multiple dataset sizes to measure real-world throughput. Each benchmark is assigned a performance tier—good, fast, blazing, or slow—and groups are scored by averaging their individual results so you can spot bottlenecks at a glance. This transparency helps you make informed decisions about which patterns scale for your use case. Learn more in the benchmarks guide.