docs(golibs/bait): add docs for lua release function

new-emitter
TorchedSammy 2022-08-16 13:41:46 -04:00
parent f2b68fe926
commit c55bf4a736
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 0 deletions

View File

@ -275,6 +275,10 @@ func (b *Bait) bcatchOnce(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.Next(), nil return c.Next(), nil
} }
// release(name, catcher)
// Removes the `catcher` for the event with `name`
// For this to work, `catcher` has to be the same function used to catch
// an event, like one saved to a variable.
func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
name, catcher, err := util.HandleStrCallback(t, c) name, catcher, err := util.HandleStrCallback(t, c)
if err != nil { if err != nil {