function asyncQueue<TFn>(options): (fn, position, runOnItemsChange) => void
function asyncQueue<TFn>(options): (fn, position, runOnItemsChange) => void
Defined in: async-queuer.ts:590
Creates a new AsyncQueuer instance with the given options and returns a bound addItem function. The queuer is automatically started and ready to process items.
Error Handling:
• TFn extends AsyncQueuerFn
AsyncQueuerOptions<TFn>
Configuration options for the AsyncQueuer
Function
A bound addItem function that can be used to add tasks to the queuer
Adds a task to the queuer
TFn
QueuePosition = ...
boolean = true
void
const enqueue = asyncQueue<string>();
// Add items to be processed
enqueue(async () => {
return 'Hello';
});
const enqueue = asyncQueue<string>();
// Add items to be processed
enqueue(async () => {
return 'Hello';
});
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.