NestInterceptor

Interface describing implementation of an interceptor.


interface NestInterceptor<T = any, R = any> {
  intercept(context: ExecutionContext, next: CallHandler<T>): Observable<R> | Promise<Observable<R>>
}

See also

Methods

intercept()

Method to implement a custom interceptor.


intercept(context: ExecutionContext, next: CallHandler<T>): Observable<R> | Promise<Observable<R>>

Parameters

Option Type Description
context ExecutionContext

an ExecutionContext object providing methods to access the route handler and class about to be invoked.

next CallHandler

a reference to the CallHandler, which provides access to an Observable representing the response stream from the route handler.

Returns

Observable<R> | Promise<Observable<R>>