Add .setPriority() for updating priority of a queued promise function#209
Conversation
|
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 |
|
@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. |
source/index.ts
Outdated
| } | ||
|
|
||
| /** | ||
| Update priority of a known promise function, using the `id` identifier, and a priority value to override existing priority value. The updated value of priority ensures whether to execute this promise function sooner or later. |
There was a problem hiding this comment.
Readme and index.d.ts should be in sync.
…anspal/p-queue into feature/update-priority
|
index.d.ts and readme should be in sync, specifically |
|
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 |
Richienb
left a comment
There was a problem hiding this comment.
This is looking pretty good
.setPriority() for updating priority of a queued promise function
Richienb
left a comment
There was a problem hiding this comment.
(Despite #209 (comment))
I'm loving it
Fixes #208 - add a
uidto track the promise functions and update the priority on any promise.also add a new event
startedto notify when a promise function is executed.