tabthedev/signally
v0.1.9 ·
A luau library which can generate class like RBXScriptSignal but custom event and more methods
Signally
A luau library which can generate class like RBXScriptSignal but custom event and more methods
Inspired by typed-remote from Sleitnick/RbxUtil
Install
pesde add tabthedev/signally
pesde install
Types
(private) connectionCallback<V...>
type connectionCallback<V...> = (V...)->()
(public) Connection<V...>
type Connection<V...> = {
Connected: boolean,
Disconnect: (self: Connection<V...>)->()
}
(public) Signal<V...>
type Signal<V...> = {
Connections: { Connection<V...> },
Yields: { thread },
Connect: (self: Signal<V...>, callback: connectionCallback<V...>)->Connection<V...>,
Once: (self: Signal<V...>, callback: connectionCallback<V...>)->Connection<V...>,
Wait: (self: Signal<V...>)->V...,
DisconnectAll: (self: Signal<V...>)->(),
CloseAllYields: (self: Signal<V...>)->(),
KillAllEffects: (self: Signal<V...>)->(),
Fire: (self: Signal<V...>, V...)->()
}
Usage
No Argument Signal
local signal = signally.new() :: Signal<>
Argument(s) Signal
local signal = signally.new() :: Signal<number, string>
Overload Agrument(s) Signal
local signal = signally.new() :: Signal<number, string> & Signal<boolean>