Skip to main content

Connection

A connection to a signal.

Properties​

Connected​

This item is read only and cannot be modified. Read Only
Connection.Connected: boolean

Whether the connection is still connected, matching RBXScriptConnection.Connected.

Functions​

new​

Connection.new(
signal: Signal<T...>,--

The signal this connection is connected to

fn: (...T) → (),--

The function handler for this connection

nextConnection: Connection<T...>?--

The connection after this one, so the table is built at its final size

) → Connection

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

IsConnected​

Connection.IsConnected(self: Connection<T...>) → boolean

Returns whether the connection is still connected.

Disconnect​

Connection.Disconnect(self: Connection<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) -> ()"
                },
                {
                    "name": "nextConnection",
                    "desc": "The connection after this one, so the table is built at its final size",
                    "lua_type": "Connection<T...>?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Connection"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 97,
                "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": 117,
                "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": 127,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Alias for [Disconnect]",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 150,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Connected",
            "desc": "Whether the connection is still connected, matching [RBXScriptConnection.Connected].",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 66,
                "path": "src/signal/src/Shared/Signal.lua"
            }
        }
    ],
    "types": [],
    "name": "Connection",
    "desc": "A connection to a signal.",
    "source": {
        "line": 56,
        "path": "src/signal/src/Shared/Signal.lua"
    }
}