hook( id, type, table, func, args )

instance function

Add a hook on to an event - when this event is triggered your callback will be called.


Name Type Description
id String Unique identifier for the new Monitor
type MonitorHook.Type Event to hook on to
table Table Table function belongs to - can be nil
func Function Callback function
args Any Argument to pass to callback


Type Description
Boolean True if the hook was added


The callback function should have the following signature - monitor is the Monitor that invoked the call and hook is a MonitorHook object.

function ExampleTable:exampleFunction( monitor, hook )