Skip to main content

SignalUtil

Useful functions for signals.

Functions

ConnectLimited

SignalUtil.ConnectLimited(
SignalSignalLike<T...>,
Callback(T...) → (),
Amountnumber
) → ConnectionLike

Connects the event to the callback, automaticly disconnects after the event was fired an amount of times.

ConnectUntil

SignalUtil.ConnectUntil(
SignalSignalLike<T...>,
Callback(T...) → (),
Timenumber
) → ConnectionLike

Connects the event to the callback, automaticly disconnects after the Time amount of seconds is passed.

ConnectStrict

SignalUtil.ConnectStrict(
SignalSignalLike<T...>,
Callback(T...) → boolean
) → ConnectionLike

Connects the event to the callback, if the callback returns true, it will disconnect the event.

FilterSignal

SignalUtil.FilterSignal(
SignalSignalLike<T...> | BindableEvent,
Filter(T...) → boolean,
SignalConstructor(() → S)?
) → S | BindableEvent

Clones a signal and attaches a filter to it. When the original signal provided fires, the filter will be ran. If the filter returns true, then the copy is fired aswell, if not then it will be ignored.

Show raw api
{
    "functions": [
        {
            "name": "ConnectLimited",
            "desc": "Connects the event to the callback, automaticly disconnects after the event was fired an amount of times. ",
            "params": [
                {
                    "name": "Signal",
                    "desc": "",
                    "lua_type": "SignalLike<T...>"
                },
                {
                    "name": "Callback",
                    "desc": "",
                    "lua_type": "(T...) -> ()"
                },
                {
                    "name": "Amount",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ConnectionLike\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 20,
                "path": "src/SignalUtil/init.luau"
            }
        },
        {
            "name": "ConnectUntil",
            "desc": "Connects the event to the callback, automaticly disconnects after the Time amount of seconds is passed. ",
            "params": [
                {
                    "name": "Signal",
                    "desc": "",
                    "lua_type": "SignalLike<T...>"
                },
                {
                    "name": "Callback",
                    "desc": "",
                    "lua_type": "(T...) -> ()"
                },
                {
                    "name": "Time",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ConnectionLike\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 40,
                "path": "src/SignalUtil/init.luau"
            }
        },
        {
            "name": "ConnectStrict",
            "desc": "Connects the event to the callback, if the callback returns true, it will disconnect the event. ",
            "params": [
                {
                    "name": "Signal",
                    "desc": "",
                    "lua_type": "SignalLike<T...>"
                },
                {
                    "name": "Callback",
                    "desc": "",
                    "lua_type": "(T...) -> boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ConnectionLike\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 53,
                "path": "src/SignalUtil/init.luau"
            }
        },
        {
            "name": "FilterSignal",
            "desc": "Clones a signal and attaches a filter to it.\nWhen the original signal provided fires, the filter will be ran.\nIf the filter returns true, then the copy is fired aswell, if not then it will be ignored.",
            "params": [
                {
                    "name": "Signal",
                    "desc": "",
                    "lua_type": "SignalLike<T...> | BindableEvent"
                },
                {
                    "name": "Filter",
                    "desc": "",
                    "lua_type": "(T...) -> boolean"
                },
                {
                    "name": "SignalConstructor",
                    "desc": "",
                    "lua_type": "(() -> S)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "S | BindableEvent\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 72,
                "path": "src/SignalUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SignalUtil",
    "desc": "Useful functions for signals.",
    "source": {
        "line": 15,
        "path": "src/SignalUtil/init.luau"
    }
}