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

Context object

target

object

Target class (for static methods) or object (for instance methods)

methodName

string

Method name

args

InvocationArgs

An array of argument values

options

InvocationOptions

(Optional) Options for the invocation

Returns:

ValueOrPromise<InvocationResult>