sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.45k stars 185 forks source link

Allow `.sizeBy()` to filter for any option #156

Closed slavb18 closed 2 years ago

slavb18 commented 3 years ago

queue.sizeBy currently supports filtering by priority only it could be extended to any prop e.g.

const options = { uid: '341a0c1b-147a-4b8e-9b9d-186773918a25' };
queue.add(() => delay(2000), options);
console.log('size by', queue.sizeBy({ uid: '341a0c1b-147a-4b8e-9b9d-186773918a25' }));
sindresorhus commented 3 years ago

Can you add a test and docs updates?

sindresorhus commented 2 years ago

Bump :)

sindresorhus commented 2 years ago

Tests are not passing.

Richienb commented 2 years ago

Bump :)