Hello everybody! I have a quick question about how lua modules work. Here is an example of my module:
local module = {}
– a load of functions
return module
In a separate script I then call ‘require’ on the module and call the functions when needed.
My question is, given that the code in the module ends with ‘return module’, does that mean the entire contents of the module are returned to my separate script every time I call one of the module’s functions, or does this happen just once when it I call ‘require’ on the module?
If it’s the former, then I’m thinking lots of small modules might be better than one big module in terms of speed.
Many thanks.