latest update causes all instances of `add` to return response | void
vidarc opened this issue · 5 comments
vidarc commented
import PQueue from 'p-queue'
const queue = new PQueue();
// has type Promise<string | void>
const result = queue.add(() => 'testing');
I would initially expect result to have type of Promise<string>
. This commit 8184655 seems to have changed that behavior.
If I'm reading the types correctly, doing
queue.add(() => 'testing', { throwOnTimeout: true })
should bring back the old typing, but it doesn't.
sindresorhus commented
// @Richienb
Richienb commented
Added type tests
beeequeue commented
This is still occurring on 7.3.4. See https://github.com/BeeeQueue/dota-matches-api/actions/runs/4212473470/jobs/7311519688
Richienb commented
This is still occurring on 7.3.4. See BeeeQueue/dota-matches-api/actions/runs/4212473470/jobs/7311519688
The p-queue
API could be improved. For now, pass throwOnTimeout: true
as an option.
tylerhellner commented
Still happening on the current release.