Defined in: queuer.ts:77
Options for configuring a Queuer instance.
These options control queue behavior, item expiration, callbacks, and more.
• TValue
optional addItemsTo: QueuePosition;
optional addItemsTo: QueuePosition;
Defined in: queuer.ts:82
Default position to add items to the queuer
'back'
'back'
optional expirationDuration: number;
optional expirationDuration: number;
Defined in: queuer.ts:87
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: queuer.ts:92
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: queuer.ts:97
Default position to get items from during processing
'front'
'front'
optional getPriority: (item) => number;
optional getPriority: (item) => number;
Defined in: queuer.ts:102
Function to determine priority of items in the queuer Higher priority items will be processed first
TValue
number
optional initialItems: TValue[];
optional initialItems: TValue[];
Defined in: queuer.ts:106
Initial items to populate the queuer with
optional initialState: Partial<QueuerState<TValue>>;
optional initialState: Partial<QueuerState<TValue>>;
Defined in: queuer.ts:110
Initial state for the queuer
optional maxSize: number;
optional maxSize: number;
Defined in: queuer.ts:114
Maximum number of items allowed in the queuer
optional onExecute: (item, queuer) => void;
optional onExecute: (item, queuer) => void;
Defined in: queuer.ts:122
Callback fired whenever an item is removed from the queuer
TValue
Queuer<TValue>
void
optional onExpire: (item, queuer) => void;
optional onExpire: (item, queuer) => void;
Defined in: queuer.ts:118
Callback fired whenever an item expires in the queuer
TValue
Queuer<TValue>
void
optional onItemsChange: (queuer) => void;
optional onItemsChange: (queuer) => void;
Defined in: queuer.ts:126
Callback fired whenever an item is added or removed from the queuer
Queuer<TValue>
void
optional onReject: (item, queuer) => void;
optional onReject: (item, queuer) => void;
Defined in: queuer.ts:130
Callback fired whenever an item is rejected from being added to the queuer
TValue
Queuer<TValue>
void
optional started: boolean;
optional started: boolean;
Defined in: queuer.ts:134
Whether the queuer should start processing tasks immediately
optional wait: number | (queuer) => number;
optional wait: number | (queuer) => number;
Defined in: queuer.ts:140
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.