I am reading Promise.all() guide but not seems what I need, I need to do something as console.log(Promise.LIST_OF_ALL_CREATED)
and see a list (array or object) of all promises. I not know the promise IDs or variable names.
I need for debug list... And also for example, await
all, or some selected ones.
The result of Promise.new()
is just a reference to the promise. If you want to list all promises in an application, you need to get a reference to them when they're created.
Promise.all()
is not related to getting all active promises in an application, it's used for something else.
There is no magical way to get a list of all "in flight" promises in an application. You just need to get the variable references, the same way you would do for any other variable.