Defined in: packages/ember-pacer/src/queuer/useQueuer.ts:91
Creates and retains the Queuer for its Ember owner.
Retains items until they are processed. Use addItem to enqueue work and start, stop, execute, clear, or flush to control processing. Selected state exposes pending items, capacity, and completed work.
Pass a selector to track only the state consumed by the owner. The default selection is {}, so utility state changes do not update the owner unless it opts in. Selection uses shallow comparison. The raw store remains available for additional subscriptions. The selector is the second positional argument. Read utility.state from the template. The contextual utility.Subscribe helper selects state for a child template.
Available state fields:
Tracked named arguments update options after rendering. createPacerScope supplies shared defaults through contextual helpers. Local named options override those defaults. Removing the helper invocation calls stop(). onUnmount replaces default cleanup and receives the same adapter instance. A custom callback must perform all required cleanup. Use flush() where supported to finish pending work.
import { on } from '@ember/modifier'
import { fn } from '@ember/helper'
import { useQueuer } from '@tanstack/ember-pacer'
import type { QueuerState } from '@tanstack/ember-pacer'
const select = (state: QueuerState<string>) => ({ size: state.size })
<template>
{{#let (useQueuer @process select wait=100) as |utility|}}
<button {{on "click" (fn utility.addItem "item")}}>Schedule</button>
<span>{{utility.state.size}}</span>
{{/let}}
</template>TValue
TSelected = { }
new UseQueuer<TValue, TSelected>(owner?): UseQueuer;Defined in: node_modules/.pnpm/ember-source@7.3.0_@glimmer+component@2.1.1_supports-color@7.2.0__supports-color@7.2.0/node_modules/ember-source/types/stable/@ember/object/index.d.ts:28
Owner
UseQueuer
Helper<{
Args: {
Positional:
| [fn: (item: TValue) => void]
| [
fn: (item: TValue) => void,
selector: (state: QueuerState<TValue>) => TSelected,
]
Named: EmberQueuerOptions<TValue, TSelected>
}
Return: EmberQueuer<TValue, TSelected>
}>.constructorcompute(positional, options): EmberQueuer<TValue, TSelected>;Defined in: packages/ember-pacer/src/queuer/useQueuer.ts:111
Override this function when writing a class-based helper.
[(item) => void, (state) => TSelected]
The positional arguments to the helper
EmberQueuerOptions<TValue, TSelected>
EmberQueuer<TValue, TSelected>
compute
1.13.0
Helper.compute