{"id":"wiam77/swan","name":"swan","scope":"wiam77","platform":"roblox","description":"Simple state management library. Docs: https://wiam.codeberg.page/swan","version":"1.1.0","latest":"1.1.0","versions":["0.1.0","0.1.1","0.1.2","1.0.0","1.1.0"],"license":"GPL-3.0","licenseRating":"unsafe","licenseCaveats":["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."],"licenseVerified":false,"dependencies":{},"integrity":"928c5b31718a7c7f4ae73298918f3ad9e50d3ab5ea8c7819cd4d08b3e0f684c0","likes":0,"downloads":0,"install":"forest install wiam77/swan","url":"https://forest.dev/p/roblox/wiam77/swan","files":"https://api.forest.dev/ai/package/roblox/wiam77/swan/files","readme":"# swan\n`swan` is a simple state management library for Luau.\n\n# Installation\n## Pesde\n```console\n# pesde add wiam/swan && pesde install\n```\n\n## Wally\nAdd the following to your `wally.toml`, in the `[dependencies]` section:\n```toml\nswan = \"wiam77/swan@<version>\"\n```\n\nThen run:\n```console\n# wally install\n```\n\n## npm\n`swan` provides typings for TypeScript.\n```console\n# npm install @rbxts/swan\n```\n\n# Documentation\nYou can read `swan`'s documentation [here](https://wiam.codeberg.page/swan).\n\n# Demo\n```luau\nlocal bullets = state(100)\nlocal main_frame = create(\"Frame\", {\n\tBackgroundColor3 = Color3.new(),\n\tSize = UDim2.fromScale(1, 1),\n\tChildren = {\n\t\tcreate(\"UIGridLayout\", {\n\t\t\tCellSize = UDim2.fromOffset(100, 100)\n\t\t}),\n\t\tbullets_label = create(\"TextLabel\", {\n\t\t\tText = \"Bullets: \"..bullets :: string -- implicit derived\n\t\t}),\n\t\tshoot_button = create(\"TextButton\", {\n\t\t\tText = \"Shoot\",\n\t\t\tMouseButton1Down = function()\n\t\t\t\tbullets(bullets.value - 1)\n\t\t\tend\n\t\t})\n\t}\n})\n```\n","readmeTruncated":false}