Re best practice, is it OK to put key variables as a global (_G) to allow easy access throughout your application? Would alleviate the need to have to “require” them in each file you’re using them in.
For example say:
* you model variable (that stores details of objects)
* a Utils set of functions
As an example:
-- Main.lua
\_G.Utils = require("common/utils")
-- Elsewhere
local testTable = {["A"] = "test", ["B"] = "array"}
Utils.dump("TEST ", testTable, 10)
[import]uid: 140210 topic_id: 25748 reply_id: 325748[/import]
[import]uid: 52491 topic_id: 25748 reply_id: 104174[/import]