So I have to pass a simple boolean to a library. In order to get the value to return I have to evaluate the resolution of a promise(it makes a asynchronous call). So I have something like this:
import {funcThatReturnsPromise} from 'some-module';
function someFunc(someParam) {
funcThatReturnsPromise(someParam).then(theResult => someOtherFunc(theResult));
}
function someOtherFunc(someParam) {
....
return true; // do some things and return a bool
}
The problem is that this returns a promise, not the bool. I can't (without forking a third party project) modify the calling code to handle a promise rather than a bool. I know the whole point of promises is to be able to handle asynchronous calls without nesting but in this case I need to handle things synchronously. I'm not sure how to do that. I've looked through the docs but I'm not seeing a way to do this. Could anyone point me in the right direction here?