Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Accessibility
Vuetify

Sign in

Sign in with your preferred provider to access your account.

createQueue API

API reference for the createQueue composable.

Functions

createQueue

(_options?: QueueOptions) => R

Creates a new queue instance

createQueueContext

(_options?: QueueContextOptions) => ContextTrinity<R>

Creates a new queue context.

useQueue

(namespace?: string) => R

Returns the current queue instance.

Options

events

boolean

Enable event emission for registry operations

Default: false

reactive

boolean

Enable reactive behavior for registry operations

Default: false

timeout

number

Default timeout in milliseconds for tickets without explicit timeout

Default: 3000

Properties

collection

ReadonlyMap<ID, Z>

The collection of tickets in the registry

size

number

The number of tickets in the registry

Methods

clear

() => void

Clear the entire registry

has

(id: ID) => boolean

Check if a ticket exists by ID

keys

() => readonly ID[]

Get all registered IDs

browse

(value: Z["value"]) => ID[] | undefined

Browse for an ID(s) by value

lookup

(index: number) => ID | undefined

lookup a ticket by index number

get

(id: ID) => Z | undefined

Get a ticket by ID

upsert

(id: ID, ticket?: Partial<Z>) => Z

Update or insert a ticket by ID

values

() => readonly Z[]

Get all values of registered tickets

entries

() => readonly [ID, Z][]

Get all entries of registered tickets

reindex

() => void

Reset the index directory and update all tickets

seek

(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => Z | undefined

Seek for a ticket based on direction and optional predicate

on

<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => void

Listen for registry events

off

<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => void

Stop listening for registry events

emit

<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<Z, K>) => void

Emit an event with data

dispose

() => void

Clears the registry and removes all listeners

onboard

(registrations: Partial<Z>[]) => Z[]

Onboard multiple tickets at once

batch

<R>(fn: () => R) => R

Execute operations in a batch, deferring cache invalidation and event emission until complete

register

(ticket?: Partial<Z>) => E

Register a new ticket in the queue (accepts input type, returns output type)

unregister

(id?: ID) => E | undefined

Unregister a ticket from the queue

pause

() => E | undefined

Pause the timeout of the first ticket in the queue

resume

() => E | undefined

Resume the timeout of the first paused ticket in the queue

offboard

(ids: ID[]) => void

Batch unregister tickets from the queue

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/