Currently, user must always copy/paste { throwOnTimeout: true }
in each and every .add()
call otherwise they end up with void
in their typings:
import Queue from "p-queue"
const queue = new Queue({
concurrency: 1,
interval: 1500,
intervalCap: 1,
throwOnTimeout: true, // regardless of this
})
// typed as number | void
const value1 = await queue.add(async () => 123)
// typed as number
const value2 = await queue.add(async () => 123, { throwOnTimeout: true })
Can we please have some way to reduce this boilerplate? Either extend class typings to lookup the init options, or add a shortcut method such as queue.execute
(?) which will do { throwOnTimeout: true }
on its own.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too