p-queue
p-queue copied to clipboard
Feature/update priority
#208 - add a uid to track the promise functions and update the priority on any promise.
also add a new event started to notify when a promise function is executed.
requested changes have been pushed! @Richienb
I think we should allow searching by the object returned by enqueue as well. What do you think? Does there remain a use case where a string id remains more useful?
@Richienb that would be a very nice idea, and will not require id property. The problem that I faced was enqueue accepts RunFunction - which in my understanding is a callback not accessible to the end-user.
The Idea of priority update - is for the user to be able to update the priority on the fly, currently this is achieved by a unique id assigned by user, or this can be passed using the invoke event as added in #210 incase assigned by #idAssigner.
@Richienb, @sindresorhus , Please suggest further.
Needs to be added to the readme.
I would like to see some more tests.
And the pull request needs a proper title.
index.d.ts and readme should be in sync, specifically setPriority
Ok @sindresorhus ! would you suggest I add the code snippets as well in the json doc comment just as we have in the readme? Or please suggest otherwise. 🙂
Yes