You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, user must always copy/paste { throwOnTimeout: true } in each and every .add() call otherwise they end up with void in their typings:
importQueuefrom"p-queue"constqueue=newQueue({concurrency: 1,interval: 1500,intervalCap: 1,throwOnTimeout: true,// regardless of this})// typed as number | void constvalue1=awaitqueue.add(async()=>123)// typed as numberconstvalue2=awaitqueue.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.
The text was updated successfully, but these errors were encountered:
Currently, user must always copy/paste
{ throwOnTimeout: true }
in each and every.add()
call otherwise they end up withvoid
in their typings: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.The text was updated successfully, but these errors were encountered: