mount
mount copied to clipboard
We can simple return next() without awaiting
It is one little simplification.
this is true, but I try to avoid this as it affects try/catch behavior
@jonathanong do you mean that it will break try/catch behavior?
For me that looks like "early exit":
// koa-mount
return async function (ctx, upstream) {
// ...
if (!newPath) return upstream()
// some middleware
async function (ctx, next) {
return next()
Am I wrong?
@jonathanong
Hi,
I think @nervgh 's idea is right, because the try/catch behavior has been handled in the koa-compose/index.js#L41