Getting Started
New Solver Required
NamedSignal is built for the New Luau Type Solver, and its types are not compatible with the old solver. See Compatibility for more details.
Installation
- Download the latest release from https://github.com/Nowoshire/NamedSignal/releases/latest.
- Place the
.luauor.rbxmfile in your preferred location.
- Add
Signal = "nowoshire/namedsignal@^1.0.0"to your wally.toml dependencies. - Run
wally installin your terminal.
Usage
The library currently returns a table with one interface function: Signal.new(), which you use to create signals:
local Signal = require(path.to.namedsignal)
local exampleEvent = Signal.new() :: Signal.Signal<(say: string) -> ()>
-- Anonymous function auto-fill fully autocompletes parameter names!
exampleEvent:Connect(function(say: string)
print(say)
end)
-- And everything else is fully typed too!
exampleEvent:Fire("Hello, world!")
See API Reference for a list of all members.