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.
Arguments
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 |
Returns
Type | Description |
---|---|
Boolean | True if the hook was added |
Notes
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 )