How would I setup my ModuleScript and interact with it to maintain a Singleton design (a single instance)?
I’ve been running into cyclic table issues since I’m just referencing the ModuleScript itself when trying to refer to it through bindables or a remote.
Do I just not use setmetatable to set it?
My general classes are setup as so:
local ExampleRepo = {}
ExampleRepo.__index = ExampleRepo
ExampleRepo.ClassName = "ExampleRepo"
function ExampleRepo:init()
setmetatable(self, ExampleRepo)
return self
end
return ExampleRepo