UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

26 lines (25 loc) • 619 B
import { Queue } from './Queue.js'; import { nextTick } from './nextTick.js'; /** * Manage tasks in a smart queue. * Tasks will be automatically batch-called inside a single event loop * lasting no more than 50ms, which is considered a long task. */ export declare class SmartQueue extends Queue { /** * A function to schedule the next batch. */ waiter: typeof nextTick; /** * Class constructor. */ constructor(); /** * Flush current batch. */ flush(): void; /** * Run the queue. */ run(tasks: Array<(...args: unknown[]) => unknown>): void; }