Defined in: async-queuer.ts:100
• TValue
optional addItemsTo: QueuePosition;
optional addItemsTo: QueuePosition;
Defined in: async-queuer.ts:105
Default position to add items to the queuer
'back'
'back'
optional concurrency: number | (queuer) => number;
optional concurrency: number | (queuer) => number;
Defined in: async-queuer.ts:111
Maximum number of concurrent tasks to process. Can be a number or a function that returns a number.
1
1
optional expirationDuration: number;
optional expirationDuration: number;
Defined in: async-queuer.ts:116
Maximum time in milliseconds that an item can stay in the queue If not provided, items will never expire
optional getIsExpired: (item, addedAt) => boolean;
optional getIsExpired: (item, addedAt) => boolean;
Defined in: async-queuer.ts:121
Function to determine if an item has expired If provided, this overrides the expirationDuration behavior
TValue
number
boolean
optional getItemsFrom: QueuePosition;
optional getItemsFrom: QueuePosition;
Defined in: async-queuer.ts:126
Default position to get items from during processing
'front'
'front'
optional getPriority: (item) => number;
optional getPriority: (item) => number;
Defined in: async-queuer.ts:132
Function to determine priority of items in the queuer Higher priority items will be processed first If not provided, will use static priority values attached to tasks
TValue
number
optional initialItems: TValue[];
optional initialItems: TValue[];
Defined in: async-queuer.ts:136
Initial items to populate the queuer with
optional initialState: Partial<AsyncQueuerState<TValue>>;
optional initialState: Partial<AsyncQueuerState<TValue>>;
Defined in: async-queuer.ts:140
Initial state for the async queuer
optional key: string;
optional key: string;
Defined in: async-queuer.ts:145
Optional key to identify this async queuer instance. If provided, the async queuer will be identified by this key in the devtools and PacerProvider if applicable.
optional maxSize: number;
optional maxSize: number;
Defined in: async-queuer.ts:149
Maximum number of items allowed in the queuer
optional onError: (error, item, queuer) => void;
optional onError: (error, item, queuer) => void;
Defined in: async-queuer.ts:155
Optional error handler for when a task throws. If provided, the handler will be called with the error and queuer instance. This can be used alongside throwOnError - the handler will be called before any error is thrown.
unknown
TValue
AsyncQueuer<TValue>
void
optional onExpire: (item, queuer) => void;
optional onExpire: (item, queuer) => void;
Defined in: async-queuer.ts:159
Callback fired whenever an item expires in the queuer
TValue
AsyncQueuer<TValue>
void
optional onItemsChange: (queuer) => void;
optional onItemsChange: (queuer) => void;
Defined in: async-queuer.ts:163
Callback fired whenever an item is added or removed from the queuer
AsyncQueuer<TValue>
void
optional onReject: (item, queuer) => void;
optional onReject: (item, queuer) => void;
Defined in: async-queuer.ts:167
Callback fired whenever an item is rejected from being added to the queuer
TValue
AsyncQueuer<TValue>
void
optional onSettled: (item, queuer) => void;
optional onSettled: (item, queuer) => void;
Defined in: async-queuer.ts:171
Optional callback to call when a task is settled
TValue
AsyncQueuer<TValue>
void
optional onSuccess: (result, item, queuer) => void;
optional onSuccess: (result, item, queuer) => void;
Defined in: async-queuer.ts:175
Optional callback to call when a task succeeds
any
TValue
AsyncQueuer<TValue>
void
optional started: boolean;
optional started: boolean;
Defined in: async-queuer.ts:179
Whether the queuer should start processing tasks immediately or not.
optional throwOnError: boolean;
optional throwOnError: boolean;
Defined in: async-queuer.ts:185
Whether to throw errors when they occur. Defaults to true if no onError handler is provided, false if an onError handler is provided. Can be explicitly set to override these defaults.
optional wait: number | (queuer) => number;
optional wait: number | (queuer) => number;
Defined in: async-queuer.ts:191
Time in milliseconds to wait between processing items. Can be a number or a function that returns a number.
0
0
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.