Page Contents
Home > @loopback/context > createProxyWithInterceptors
createProxyWithInterceptors() function
Create a proxy that applies interceptors for method invocations
Signature:
export declare function createProxyWithInterceptors<T extends object>(target: T, context?: Context, session?: ResolutionSession, source?: InvocationSource): AsyncProxy<T>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| target | T | Target class or object |
| context | [Context](/doc/en/lb4/apidocs.context.context.html) | _(Optional)_ Context object |
| session | [ResolutionSession](/doc/en/lb4/apidocs.context.resolutionsession.html) | _(Optional)_ Resolution session |
| source | [InvocationSource](/doc/en/lb4/apidocs.context.invocationsource.html) | _(Optional)_ Invocation source |
Returns:
AsyncProxy<T>