RSX Code Reference
    Preparing search index...
    • rsx
    • editorInjection

    Function editorInjection

    • Injects a function call on the decorated method. If the application is executed in runtime mode, and not in the editor. The injection is disabled and the decorator is zero-cost. In editor mode, the fnOnInvoke callback will be invoked before calling the decorated method. The fnOnDidInvoke callback will be invoked after the decorated method was invoked.

      Type Parameters

      • T

      Parameters

      • OptionalfnOnInvoke: (self: T, args?: IArguments) => void
      • OptionalfnOnDidInvoke: (self: T, returnValue?: any, args?: IArguments) => void

      Returns (target: any, key: string, descriptor: PropertyDescriptor) => void

      The this pointer will be passed as first argument. The fnOnDidInvoke method will receive the return value as second argument. The last argument for both calls is the arguments used to invoke the decorated method. It is recommend to set the this pointer type manually to enable contextual code completion.

       fnOnInvoke(self: Component, args?:IArguments)
      fnOnDidInvoke(self: Component, returnValue?:any, args?:IArguments)