local function _create_dispatcher(event) -- FIXME duplicate code in fire_event\r
local h = handlers[event];\r
if not h then h = {}; handlers[event] = h; end\r
- local dispatcher = function(data)\r
+ local dispatcher = function(...)\r
for _, handler in ipairs(h) do\r
- local ret = handler(data);\r
+ local ret = handler(...);\r
if ret ~= nil then return ret; end\r
end\r
end;\r
local function get_dispatcher(event)\r
return dispatchers[event] or _create_dispatcher(event);\r
end;\r
- local function fire_event(event, data) -- FIXME duplicates dispatcher code\r
+ local function fire_event(event, ...) -- FIXME duplicates dispatcher code\r
local h = handlers[event];\r
if h then\r
for _, handler in ipairs(h) do\r
- local ret = handler(data);\r
+ local ret = handler(...);\r
if ret ~= nil then return ret; end\r
end\r
end\r