From c55bf4a73688990286d71ae2c692f5c8cbe6b17c Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Tue, 16 Aug 2022 13:41:46 -0400 Subject: [PATCH] docs(golibs/bait): add docs for lua release function --- golibs/bait/bait.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/golibs/bait/bait.go b/golibs/bait/bait.go index b22731e..89e0c4a 100644 --- a/golibs/bait/bait.go +++ b/golibs/bait/bait.go @@ -275,6 +275,10 @@ func (b *Bait) bcatchOnce(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { 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) { name, catcher, err := util.HandleStrCallback(t, c) if err != nil {