Function wrapThisFunction

  • Call f1 before calling f2 Sample usage

    const logRender = ()=>console.log('render')
    obj.render = wrapThisFunction(logRender, obj.beforeRender)
    // now calling obj.beforeRender(), will log 'render' and then call obj.beforeRender()

    Type Parameters

    Parameters

    • f1: (() => void)
        • (): void
        • Returns void

    • Optional f2: T

    Returns T

Generated using TypeDoc