DEV Community

Discussion on: Elegant way to check if a Promise is pending

Collapse
 
callmelann profile image
CallMeLaNN

I'm not sure if I understand correctly, but maybe you not using Promise in a way you imagine the outcome.

If you chain the promises (to put observe it in the middle of the chain) the original consumer of the final promise in the chain doesn't affected as long as you pass the resolve value around.

If you append more .then() to the original promise, you can get notified and the consumer of the promise unaffected.

It doesn't affect the performance or lag unless you add sync I/O, it is just code structure. I believe there will be an extra tiny processing of inspect above then using plain Promise#then