p-queue
p-queue copied to clipboard
How do I remove a specific queue'd item?
So say I queue up 5-10 async functions, then want to cancel maybe the fifth one. How would I go about doing that?
Looked through the code and couldn't find a remove or delete. Looks like there is a dequeue but that seems to work similar to the Array pop method.
I started this for my own needs https://github.com/sindresorhus/p-queue/issues/140
Hmm really more difficult than expected. Task requires a TaskResultType which is derivable from the code somehow. Also task in itself is not exported. I think I'd have to cheat and use any in the end.