From c6e6ec858ccbd2b633c4dcc824a80bf8dbda5cfb Mon Sep 17 00:00:00 2001 From: Max Cahill <1bardesign@gmail.com> Date: Tue, 8 Nov 2022 09:20:37 +1100 Subject: [PATCH] fixed accidentally global callback in subscribe_once --- pubsub.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubsub.lua b/pubsub.lua index 2d7b386..8cb6765 100644 --- a/pubsub.lua +++ b/pubsub.lua @@ -98,7 +98,7 @@ end --subscribe to an event, automatically unsubscribe once called function pubsub:subscribe_once(event, callback) local called = false - f = function(...) + local f = function(...) if not called then callback(...) self:unsubscribe(event, f)