Syntax
RealSignalConnection.Disconnect(connection: RealSignalConnection)Arguments
| Name | Type | Description |
|---|---|---|
connection | RealSignalConnection | Connection object returned by RealSignal.Connect or RealSignal.Once. |
Description
Disconnects a RealSignalConnection returned by Connect or Once. The method returns no values.
Call it with 1 parameter(s): connection. The argument table explains which values are required and which ones only refine the behavior.
It does not return data. Treat the call as an action and handle errors around the call site when needed.
Example
Disconnect a connection returned by RealSignal.Connect or RealSignal.Once.
local signal = Signal.new()
local connection = signal:Connect(function()
print("fired")
end)
connection:Disconnect()
signal:Fire()Types
RealSignal
Signal object returned by Signal.new.
Connect (callback: (...any) -> ()) -> RealSignalConnection Adds a callback that runs when Fire is called.Once (callback: (...any) -> ()) -> RealSignalConnection Adds a callback that is disconnected before its first callback invocation.Wait () -> ...any Yields until Fire resumes the waiter with the fired values.Fire (...values: any) -> () Runs connected callbacks and resumes waiters with the provided values.RealSignalConnection
Connection object returned by RealSignal.Connect and RealSignal.Once.
Disconnect () -> () Disconnects the connection.