diff --git a/versions/doc-improvements/docs/api/bait/index.html b/versions/doc-improvements/docs/api/bait/index.html index 6e3048a..dc9b52c 100644 --- a/versions/doc-improvements/docs/api/bait/index.html +++ b/versions/doc-improvements/docs/api/bait/index.html @@ -16,9 +16,13 @@ Consider this part of it:
end)
What this does is, whenever the command.exit
event is thrown,
this function will set the user prompt.
catch(name, cb) | Catches a hook with name . Runs the cb when it is thrown |
catchOnce(name, cb) | Same as catch, but only runs the cb once and then removes the hook |
hooks(name) -> table | Returns a table with hooks (callback functions) on the event with name . |
release(name, catcher) | Removes the catcher for the event with name . |
throw(name, …args) | Throws a hook with name with the provided args |
Catches a hook with name
. Runs the cb
when it is thrown
string
name
ummm
function
cb
?
catch(name, cb) | Catches a hook. This function is used to act on hooks/events. |
catchOnce(name, cb) | Same as catch, but only runs the cb once and then removes the hook |
hooks(name) -> table | Returns a table with hooks (callback functions) on the event with name . |
release(name, catcher) | Removes the catcher for the event with name . |
throw(name, …args) | Throws a hook with name with the provided args |
Catches a hook. This function is used to act on hooks/events.
string
name
The name of the hook.
function
cb
The function that will be called when the hook is thrown.
bait.catch('hilbish.exit', function()
+ print 'Goodbye Hilbish!'
+end)
+
Same as catch, but only runs the cb
once and then removes the hook
This function has no parameters.
Returns a table with hooks (callback functions) on the event with name
.
Hooks are Hilbish’s versions of events, which are used via the Bait +module. +For more detail on how to act on these hooks, you may check the Bait page.