Ian's answer focuses on technical implementation - thanks a lot. I want post additional answer that focuses on "why" with respect to the JavaScript concurrency model (I realized it when watching Modern Asynchronous JavaScript on Pluralsight.
So let's imagine piece of code:
let progressStatus;
function opThatReturnsPromise() {
return Promise.resolve();
}
opThatReturnsPromise().then(function() {
console.log(progressStatus = "Done");
})
console.log(progressStatus = "In progress...");
If "static" Promises were resolved synchronously, then this piece would result in output:
Done
In progress...
This is because of Run-to-completion. So ensuring asynchronicity, ensures consistent behaviour - no matter what is actually happening in the operation that is encapsulated by the Promise object.