mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 06:04:35 +00:00
fixed accidentally global callback in subscribe_once
This commit is contained in:
parent
94d9901728
commit
c6e6ec858c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user