Aliases

  • hookfunc
  • replaceclosure

Arguments

function
required
The function whose hook is installed, restored, or queried.
function
required
The replacement callback. Keep the returned original function when delegating calls.

Returns

function
The original callable for delegation or restoration.
Keep the returned original; calling target from its replacement can recurse. Hooks affect the target closure and references to it, not just a variable.

Example