Page Contents

Home > @loopback/context > invokeMethodWithInterceptors

invokeMethodWithInterceptors() function

Invoke a method with the given context

Signature:

export declare function invokeMethodWithInterceptors(context: Context, target: object, methodName: string, args: InvocationArgs, options?: InvocationOptions): ValueOrPromise<InvocationResult>;

Parameters

Parameter Type Description
context [Context](/doc/en/lb4/apidocs.context.context.html) Context object
target object Target class (for static methods) or object (for instance methods)
methodName string Method name
args [InvocationArgs](/doc/en/lb4/apidocs.context.invocationargs.html) An array of argument values
options [InvocationOptions](/doc/en/lb4/apidocs.context.invocationoptions.html) _(Optional)_ Options for the invocation

Returns:

ValueOrPromise<InvocationResult>