function injectQueuedSignal<TValue, TSelected>(
fn,
options,
selector): QueuedSignal<TValue, TSelected>;
Defined in: queuer/injectQueuedSignal.ts:48
An Angular function that creates a queuer with managed state, combining Angular's signals with queuing functionality. This function provides both the current queue state and queue control methods.
The queue state is automatically updated whenever items are added, removed, or reordered in the queue. All queue operations are reflected in the state array returned by the function.
The function returns a callable object:
TValue
TSelected extends Pick<QueuerState<TValue>, "items"> = Pick<QueuerState<TValue>, "items">
(item) => void
QueuerOptions<TValue> = {}
(state) => TSelected
QueuedSignal<TValue, TSelected>
// Default behavior - track items
const queued = injectQueuedSignal(
(item) => console.log('Processing:', item),
{ started: true, wait: 1000 }
);
// Add items
queued.addItem('task1');
// Access items
console.log(queued()); // ['task1']
// Control the queue
queued.queuer.start();
queued.queuer.stop();