I need to write a function that returns a boolean based on whether a promise is fulfilled or not at the moment that function is invoked. Obviously, I cannot await
the promise (otherwise, it will always be fulfilled), I need to know immediately upon calling the function whether or not the promise is fulfilled (either resolved
or rejected
).
I've been poking around SO and the internet for a solution for this, but other than util.inspect
from Node.JS that I cannot use, I haven't seen a reliable solution for this.
Any assistance would be highly appreciated!