SignalConnection: Disconnect Synchronous
Stop this connection from receiving future signal events. Use it to unsubscribe one consumer while the other listeners continue receiving events. Its Connected flag becomes false after disconnection.
Luau
SignalConnection:Disconnect() -> ()Parameters
Call this method with a SignalConnection receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
This function takes no arguments.
Returns
()This function returns no values.
Usage notes
The connection belongs to a custom Signal. Its Connected property reports whether it is still connected.
Example
Luau
local changed = Signal.new()
local listener = changed:Connect(function(value) print(value) end)
changed:Fire("received")
listener:Disconnect()
changed:Fire("not received by this listener")
print(listener.Connected) -- false
changed:Destroy()