Why yield*? is not used to execute next in koa middleware

We know that if you want to execute another generator, in one generator, you can"t use yield, directly, but use yield*

.

similarly, according to koa1"s principle, the next parameter in each middleware is actually a generator iterator.
however, why yield * next

is not used in yield next in the middleware in koa1

such as

function *a(next) {
    console.log("come a")
    yield next;
    console.log("end a")
}
Apr.05,2021

then don't you get caught up in something like callback hell?

Menu