InterceptorInterface
interface in meocord/interface Since 4.1.0
interface InterceptorInterfaceWhat an interceptor implements: intercept, which runs around the handler.
Implement it on a class marked with Interceptor, and apply the class with UseInterceptor.
Where it runs
- Interceptors — where
@UseInterceptoror@MeoCord({ interceptors })applies the class
Members
intercept
intercept(
context: ExecutionContext,
next: CallHandler,
): Promise<unknown> | unknownRuns around the handler.
Parameters
| Name | Type | Description |
|---|---|---|
context | ExecutionContext | The call being handled: its arguments, controller, handler and metadata. |
next | CallHandler | Continues with the next interceptor, then the handler. |
Returns
Promise<unknown> | unknownWhat the call returns: usually the result of next.handle().
See also
- Interceptor
- CallHandler