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)