Skip to content

Aspecky/LuauEvent

Repository files navigation

LuauSignal

A faster and more equipped Luau implementation of BindableEvent

Why?

Besides being a lot lighter and a lot faster than BindableEvent, the main motive for using this over other signal implementations is to keep methods like :Fire hidden from objects that have events, so instead of your events looking like this:

before

They would instead look like this:

after

Which makes a lot more sense given that typically the usage of :Fire is internal only.

Features

Reconnect

You take connect, you prefix it with a re, and you got yourself a handy method for reconnecting disconnected connections!

local event = LuauEvent.new()

local connection = event.Event:Connect(function(s: string)
    print(s)
end)

event:Fire("Hello world!") --> Hello world!

connection:Disconnect()

event:Fire("Goodbye world!") -- wont print anything

connection:Reconnect()

event:Fire("Hello again!") --> Hello again!

Variadic connections

When using signals, sometimes you have to make function to call another function, but with variadic connections that becomes no more!

Note: The variadics you pass when connecting will always come before the ones you pass in :Fire

local event = LuauEvent.new()

event.Event:Connect(print, "Hello")

event:Fire("world!") --> Hello world!

Installation

Wally

You may find the wally link here:
https://wally.run/package/aspecky/luauevent

Rbxm

You may find the rbxm in the releases here:
https://github.com/Aspecky/LuauEvent/releases