Because async/await is actually one level higher than Promise. An async function is not a Promise but a () => Promise. In other words, an async function is a lazy Promise.
Note that we kind of hit a dead-end above. Even though we've created p0 to store the Promise, we cannot rerun p0. The most we can do is attach more thens. We cannot cancel it either.
Because async/await is actually one level higher than
Promise
. An async function is not aPromise
but a() => Promise
. In other words, an async function is a lazyPromise
.Note that we kind of hit a dead-end above. Even though we've created
p0
to store the Promise, we cannot rerunp0
. The most we can do is attach morethen
s. We cannot cancel it either.We still cannot cancel it, but at least we can rerun it.
A more detailed explanation can be found in the Wiki of Fluture.