tabthedev/signally

A library which can generate class like RBXScriptSignal but custom event and more methods

Signally

A library which can generate class like RBXScriptSignal but custom event and more methods

Install

pesde add tabthedev/signally

psede 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>