Skip to main content

Connection

A connection to a signal.

Functions

new

Connection.new(
signalSignal<T...>,--

The signal this connection is connected to

fn(...T) → ()--

The function handler for this connection

) → Connection

Constructs a new connection object. Not useful directly, use Signal:Connect instead.

IsConnected

Connection.IsConnected(selfConnection<T...>) → boolean

Returns whether the connection is still connected.

Disconnect

Connection.Disconnect(selfConnection<T...>) → ()

Disconnects the connection from the signal.

Destroy

Connection.Destroy() → ()

Alias for [Disconnect]

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new connection object. Not useful directly, use Signal:Connect instead.",
            "params": [
                {
                    "name": "signal",
                    "desc": "The signal this connection is connected to",
                    "lua_type": "Signal<T...>"
                },
                {
                    "name": "fn",
                    "desc": "The function handler for this connection",
                    "lua_type": "(... T) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Connection"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 78,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        },
        {
            "name": "IsConnected",
            "desc": "Returns whether the connection is still connected.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Connection<T...>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        },
        {
            "name": "Disconnect",
            "desc": "Disconnects the connection from the signal.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Connection<T...>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 103,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Alias for [Disconnect]",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 141,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Connection",
    "desc": "A connection to a signal.",
    "source": {
        "line": 56,
        "path": "src/signal/src/Shared/Signal.lua"
    }
}