Skip to content

Instantly share code, notes, and snippets.

View numfin's full-sized avatar
💋

A coder numfin

💋
View GitHub Profile
class PromiseQueue {
constructor (limit = 20, cb = () => {}) {
/** @type {{promiseFn: () => Promise, cb: void}[]} */
this.queue = []
this.running = 0
this.limit = limit
this.cb = cb
}