인수
RealSignal
필수
Signal object returned by Signal.new.
(....any) -> ()
필수
Function called at most once for this connection.
반환값
RealSignalConnection
Connection object with Disconnect.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connects a callback that is disconnected before its first callback invocation. The callback receives the arguments passed to Fire.
RealSignal.Once(signal: RealSignal, callback: (....any) -> ()): RealSignalConnection
| Name | Type | Required | 설명 |
|---|---|---|---|
Connect | (callback: (...any) -> ()) -> RealSignalConnection | Yes | Adds a callback that runs when Fire is called. |
Once | (callback: (...any) -> ()) -> RealSignalConnection | Yes | Adds a callback that is disconnected before its first callback invocation. |
Wait | () -> ...any | Yes | Yields until Fire resumes the waiter with the fired values. |
Fire | (...values: any) -> () | Yes | Runs connected callbacks and resumes waiters with the provided values. |
| Name | Type | Required | 설명 |
|---|---|---|---|
Disconnect | () -> () | Yes | Disconnects the connection. |
local signal = Signal.new()
signal:Once(function(value)
print(value)
end)
signal:Fire("first")
signal:Fire("second")