문법
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.