{"id":"nazumah/signal","name":"signal","scope":"nazumah","platform":"roblox","description":"Mirrored from the Wally registry.","version":"1.0.4","latest":"1.0.4","versions":["0.1.0","0.1.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"8295fd1a47524b703b75336055df31214b176bdb3d582a0380cc6ea0ce36b8ce","likes":0,"downloads":0,"install":"forest install nazumah/signal","url":"https://forest.dev/p/roblox/nazumah/signal","files":"https://api.forest.dev/ai/package/roblox/nazumah/signal/files","readme":"# Signal\n\n[![Wally](https://img.shields.io/badge/Wally-1.0.4-blue.svg)](https://wally.run/package/nazumah/signal)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Luau](https://img.shields.io/badge/Luau-Strict-blueviolet.svg)](https://luau-lang.org/)\n\nSignal is a high-performance, type-safe implementation of the Observer pattern for Luau on Roblox. It is designed for internal communication with minimal overhead, providing advanced features like generic type support and thread-reuse optimization.\n\n---\n\n## Technical Advantages\n\n- **Zero-Allocation Firing**: Uses a custom task-runner to reuse coroutines, significantly reducing memory pressure under high-load event firing.\n- **Explicit Type System**: Unlike other libraries, Signal uses explicit interface casting in its entry point. This guarantees full IntelliSense support even when installed through Wally.\n- **Generic Support**: Fully supports Luau's variadic generics (`<T...>`), ensuring that arguments passed to `Fire` are correctly checked in `Connect`.\n- **Deferred Execution**: Native support for both immediate (`Fire`) and engine-scheduled (`FireDeferred`) execution cycles.\n\n---\n\n## Installation\n\n### Wally\nUpdate your `wally.toml`:\n\n```toml\n[dependencies]\nSignal = \"nazumah/signal@1.0.4\"\n```\n\n---\n\n## Quick Start\n\n### 1. Basic Typed Signal\n```lua\nlocal Signal = require(path.to.Signal)\n\n-- Create a signal with specific argument types\nlocal onPointsChanged = Signal.new<number>()\n\nlocal conn = onPointsChanged:Connect(function(newPoints: number)\n    print(\"Points updated:\", newPoints)\nend)\n\nonPointsChanged:Fire(100)\nconn:Disconnect()\n```\n\n### 2. Wrapping Native Events\n```lua\nlocal part = Instance.new(\"Part\")\nlocal onTouched = Signal.Wrap<BasePart>(part.Touched)\n\nonTouched:Connect(function(otherPart)\n    print(\"Touched by:\", otherPart.Name)\nend)\n```\n\n---\n\n## Resource Management\n\nFor optimal reliability, integrate Signal with resource managers like [Janitor](https://github.com/Nazumah/roblox-luau-janitor).\n\n```lua\nlocal janitor = Janitor.new()\njanitor:Add(onPointsChanged:Connect(onEvent), \"Disconnect\")\n```\n\n---\n\n## Documentation\n\n- [Why Use Signal?](docs/WhyUseSignal.md)\n- [API Reference](docs/API.md)\n\n---\n\n## License\nLicensed under the [MIT](LICENSE) License.","readmeTruncated":false}