構文
Signal.new(): RealSignal戻り値
| 名前 | 型 | 説明 |
|---|---|---|
signal | RealSignal | New signal object with its own connection and waiter lists. |
説明
Creates a new RealSignal object. The returned signal exposes Connect, Once, Wait, and Fire methods.
パラメータなしで呼び出します。関数は現在の runtime 状態から必要な context を読み取ります。
signal (RealSignal) を返します。戻り値表を使って成功値、nil 結果、回復可能なエラーを分けて扱ってください。
例
Create an independent RealSignal and fire it with values.
local signal = Signal.new()
signal:Connect(function(value)
print(value)
end)
signal:Fire("ready")型
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.