Forest Logo
search
package_2

fembindables

By @al-ex427

Roblox

Mirrored

🔗 fembindables

fembindables is a fast and minimal signal (event) system for Lua-based environments like Roblox. It provides simple APIs for creating, connecting, firing, and disconnecting events efficiently.


📊 Benchmarks

OperationIterationsTotal TimeTime per Op
fembindables.new()100,0000.0040 s39.51 ns
fembindables:Connect()50,0000.0058 s116.08 ns
fembindables:Fire() [0 connections]20,0000.0008 s39.62 ns
fembindables:Fire() [1 connection]20,0000.0008 s40.75 ns
fembindables:Fire() [100 connections]20,0000.0008 s42.11 ns
Disconnect() [last of 100]10,0000.1092 s10.92 µs
Disconnect() [first of 100]10,0000.1073 s10.73 µs
DisconnectAll() [500 connections]5,0000.2091 s41.82 µs

🚀 Usage

Create a signal

local MySignal = fembindables.new()

🔗 Connect listeners

Connect listeners (callbacks) to your signal using Connect. Each listener will be called when the signal fires.

local connection1 = MySignal:Connect(function(message)
	print("Listener 1 received:", message)
end)

local connection2 = MySignal:Connect(function(message)
	print("Listener 2 received:", message)
end)

🔥 Fire the Signal

Trigger the signal with Fire, passing any arguments to the listeners.

MySignal:Fire("Event Fired!")

Output:

Listener 1 received: Event Fired!
Listener 2 received: Event Fired!

❌ Disconnect a Listener

Disconnect a specific listener to stop receiving events.

connection1:Disconnect()

🔥Fire the signal again with a new message

Only Listener 2 will respond now

MySignal:Fire("Fired again!")

Output:

Listener 2 received: Fired again!

🔁 Disconnect All Listeners

Remove all listeners at once.

MySignal:DisconnectAll()

🔥 Fire the Signal

This wont output anything.

MySignal:Fire("Event Fired!")

Output:

 no output

NOTICE:

To use events in other scripts you can make a module that holds the events.

Package Details

Install command (Click to copy)


Version

1.0.0

License

MIT

check_circle

Safe for commercial use

infoLicense identified from the packaged LICENSE file; the manifest declared none.

Automated license review — not legal advice.