search/
Start typing to search packages!
package_2
create-signal
By @sap0bombado
Roblox
Mirroredcreate-signal
Fast, lightweight event emitter for Luau.
Benchmarked vs SignalPlus:
| Operation | createSignal | SignalPlus |
|---|---|---|
| create | 128ns | 141ns |
| connect | 444ns | 678ns |
| fire (1 listener) | 769ns | 823ns |
| fire (10 listeners) | 7884ns | 7800ns |
| disconnect | 156ns | 233ns |
Install
[dependencies]
createSignal = "sap0bombado/create-signal@1.4.3"
API
createSignal<T...>() -> Signal<T...>
Creates a new signal.
Signal<T...>
| Method | Signature | Description |
|---|---|---|
connect | (callback: (T...) -> ()) -> Connection | Register a listener |
once | (callback: (T...) -> ()) -> Connection | Register a one-shot listener |
fire | (...: T...) -> () | Fire the signal |
wait | () -> T... | Yield until the signal fires, returns the args |
disconnectAll | () -> () | Remove all listeners |
destroy | () -> () | Disconnect all and clear the signal table |
Connection
| Field/Method | Type | Description |
|---|---|---|
connected | boolean | Whether the connection is still active |
disconnect | () -> () | Disconnect this listener |
Example
local signal = createSignal<<(string, number)>>()
signal:connect(function(name, age)
print(name, age)
end)
signal:fire("John", 23)
Package Details
Install command (Click to copy)
Version
1.4.3
License
MIT
Safe for commercial use
Automated license review — not legal advice.
