I am working in a framework that requires the parent function to return true
or false
. Within that function, I'd like to run an async operation.
How do I make the parent function return true
or false
after an async action?
Example of what doesn't work:
function parent() {
const child = new Promise();
child.then(
function (success) { return true },
)
}
The problem is that returning is happining within the context of the child.then() function.