Skip to main content

Variable: MIDDLEWARE_STOP_PROPAGATION

const MIDDLEWARE_STOP_PROPAGATION: unique symbol

Defined in: packages/core/src/router/Router.ts:60

Pass this token to the next() callback in a 3-argument middleware to stop processing the remaining middlewares in the current batch while still allowing normal route handling to continue.

Example

function loggingMiddleware(params, locals, next) {
if (shouldSkipRest()) {
next(MIDDLEWARE_STOP_PROPAGATION); // skip remaining middlewares, but route still renders
} else {
next();
}
}