I was wondering about this for a while now and don’t know the answer and how to look for one. Consider following chunks of code:
file1.lua:
local M = {} local doSth = function( ... ) ... end M.doSth = doSth Runtime:addEventLinstener("doThatThing", doSth) return M
file2.lua (version 1):
local M = require("file1") M.doSth( ... )
file2.lua (version 2):
Runtime:dispatchEvent( { name = "doThatThing" , ...} )
The question:
Which option for file2 is prefered and faster? Is there any explanation on this topic anywhere?