{"id":"wiam77/rl","name":"rl","scope":"wiam77","platform":"roblox","description":"Simple reactive library for Luau. Docs: https://pesde.dev/packages/wiam/rl/latest/any/docs/intro","version":"0.2.1","latest":"0.2.1","versions":["0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.1.10","0.1.11","0.1.12","0.1.13","0.2.0","0.2.1"],"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.","The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"f86920572008156145ce457e8996f07002238cead0c1aee0523c0bf1dafa5a1d","likes":0,"downloads":0,"install":"forest install wiam77/rl","url":"https://forest.dev/p/roblox/wiam77/rl","files":"https://api.forest.dev/ai/package/roblox/wiam77/rl/files","readme":"# rl\n`rl` is a simple reactive library for Luau, inspired by [Vide](https://centau.github.io/vide)'s sources and effects system.\n\n# Installation\n## Pesde\n```console\n# pesde add wiam/rl && pesde install\n```\n\n## Wally\nAdd the following to your `wally.toml`, in the `[dependencies]` section:\n```toml\nrl = \"wiam77/rl@<version>\"\n```\n\nThen run:\n```console\n# wally install\n```\n\n## npm\n```console\n# npm install @rbxts/rl\n```\n\n# API Reference\nYou can read the API reference in `rl`'s [Pesde package page](https://pesde.dev/packages/wiam/rl/latest/any/docs/api_ref).\n\n# Demo\n```luau\n--!strict\n\nlocal rl = require(\"path/to/rl\")\nlocal s = rl.state\nlocal e = rl.effect\n\nlocal name = s(\"john\", true)\nlocal login_year = s(2020)\n\nlocal login_d = e(function(last_login : number)\n\tprint(`{name.value}, it's been {login_year() - (last_login or 0)} years!`)\nend)\n\nlogin_year(2025) -- \"wiam, it's been 5 years!\"\nlogin_year(2025) -- doesn't print because value didn't change\nlogin_year(2025, true) -- \"wiam, it's been 0 years!\" - this prints since it's forced\n\nname(\"doe\") -- doesn't print because we are reading with name.value, and not name()\n\ne(function(old_name : string)\n\tprint(`hey {old_name}, your name has been changed to '{name()}'`)\nend)\n\nname(\"jane\") -- \"hey doe, your name has been changed to jane\"\nname(\"jane\") -- \"hey jane, your name has been changed to jane\" - this one is forced by default\n\nlogin_d()\nlogin_year(2026) -- doesn't print because the effect was disconnected\n\nrl.cleanup() -- disconnect all effects\n```","readmeTruncated":false}