search/
Start typing to search packages!
package_2
swan
By @wiam77
Roblox
Mirroredswan
swan is a simple state management library for Luau.
Installation
Pesde
# pesde add wiam/swan && pesde install
Wally
Add the following to your wally.toml, in the [dependencies] section:
swan = "wiam77/swan@<version>"
Then run:
# wally install
npm
swan provides typings for TypeScript.
# npm install @rbxts/swan
Documentation
You can read swan's documentation here.
Demo
local bullets = state(100)
local main_frame = create("Frame", {
BackgroundColor3 = Color3.new(),
Size = UDim2.fromScale(1, 1),
Children = {
create("UIGridLayout", {
CellSize = UDim2.fromOffset(100, 100)
}),
bullets_label = create("TextLabel", {
Text = "Bullets: "..bullets :: string -- implicit derived
}),
shoot_button = create("TextButton", {
Text = "Shoot",
MouseButton1Down = function()
bullets(bullets.value - 1)
end
})
}
})
Package Details
Install command (Click to copy)
Version
1.1.0
License
GPL-3.0
Legal risk for closed-source games
Strong copyleft: shipping this in your game plausibly requires releasing your game's entire source under GPL-3.0. Not recommended for closed-source projects.
Automated license review — not legal advice.
