Skip to content

Repository files navigation

Startup

A simple knit-like Startup

Installion

Wally

Example

On client,

local Startup = require("path/to/startup")

local app = Startup.new()

app:add(require("@controllers/hello-controller"))
app:add(require("@controllers/world-controller"))

app:run()

When on server.

local Startup = require("path/to/startup")

local app = Startup.new()

app:add(require("@services/hello-service"))

app:run()

Extend

local app = Startup.new()

app:add({
    onPlayerAdded = function(player: Player)
    end
}) -- the example of required module

local function playerAdded(player: Player)
    app:execute("onPlayerAdded", player)
end

for _, player in Players:GetPlayers() do
    task.spawn(playerAdded, player)
end
Players.PlayerAdded:Connect(playerAdded)

Exception

local app = Startup.new()

app:except(function(err: unknown) -- the promise error handler, single.
    print(err)
end)

About

A simple knit-like Startup

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages