The entire purpose of the resolve
and reject
callbacks is that they can be called at any time, even after the construction function has finished. This makes is useful for asynchronous operations which can be started at construction but not completed before the constructor completes. As your examples only deal with the synchronous case, this advantage is lost. (...actually, it's more than an advantage... it's the entire reason for the existence of Promises).
You can also return promises from your continuations, such that the subsequent continuation (or .then
clause) will only run when the previously returned Promise
has completed. All good, but you'd be left with the problem of how to make an async promise in the first place without the original interface.