loading...

re: Elegant way to check if a Promise is pending VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I mean this is cool and all, but I'm not really sure when one would ever want to know when a promise is "pending". It's a fun experiment for the s...
 

If you're dealing with a scenario where you have a lot of promises and you wanted to just check the state for reporting or something, you must then define a bunch of variables for every promise which is ugly imho.

 

In that case, assuming a Node environment as in your example in the article, wouldn't it be better (and more readable) to implement an event emitter instead?

It seems to me that promises may be the wrong abstraction for the job.

code of conduct - report abuse