pillarworks/framework

a simple module loader

framework

  • this module is a simple module loader, used in pillarworks.
  • this is a shared module. this will work on the client and server.

usage

local framework = require(path.to.framework)
local singletons = {}

framework.run({
  lifecycles = { "start", "stop" },
  singletons = singletons,
})

game:BindToClose(function()
	framework.utils.run_lifecycle(config, "stop", true)
end)

example singleton

local singleton = {}

singleton.identifier = "example_singleton"

export type self = typeof(singleton)

function singleton.start(self: self)
  print("singleton started")
end

function singleton.stop(self: self)
  print("singleton stopped")
end

return singleton