Skip to content

Patcher Api

after(id, object, method, callback): () => void

Runs a callback after a function on an object has been run

ParameterType
idstring
objectany
methodstring
callback(thisVal, args, returnVal) => any

Function

A function to remove the patch

void


before(id, object, method, callback): () => void

Runs a callback before a function on an object has been run. Return true from the callback to prevent the function from running

ParameterType
idstring
objectany
methodstring
callback(thisVal, args) => boolean | void

Function

A function to remove the patch

void


instead(id, object, method, callback): () => void

Runs a function instead of a function on an object

ParameterType
idstring
objectany
methodstring
callback(thisVal, args) => void

Function

A function to remove the patch

void


unpatchAll(id): void

Removes all patches with a given id

ParameterType
idstring

void