Signal: Once Synchronous
KawaiiSignal:OncePsmSignal:OnceVoltSignal:Once
Subscribe a callback for just the next firing of a custom Signal. The listener disconnects before its callback runs.
Luau
Signal:Once(callback: Function) -> SignalConnectionParameters
Call this method with a Signal receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
| Parameter | Type | Description |
|---|---|---|
callback | Function | Function that receives the arguments from the next Fire. |
Returns
SignalConnectionA SignalConnection; you can disconnect it before the event arrives.
Luau
SignalConnection = {Connected: boolean, Disconnect: Function}Usage notes
Use Once for a one-time transition such as initialization completion. Repeated Fire calls do not invoke this callback again.
Example
Luau
local ready = Signal.new()
ready:Once(function(value) print("First:", value) end)
ready:Fire("loaded")
ready:Fire("ignored by Once")
ready:Destroy()