> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# RealSignal.Once

> Connects a callback that is disconnected before its first callback invocation. The callback receives the arguments passed to Fire.

<div className="real-function-page">
  ```lua theme={null}
  RealSignal.Once(signal: RealSignal, callback: (....any) -> ()): RealSignalConnection
  ```

  ## Arguments

  <ParamField path={"signal"} type={"RealSignal"} required>
    Signal object returned by Signal.new.
  </ParamField>

  <ParamField path={"callback"} type={"(....any) -> ()"} required>
    Function called at most once for this connection.
  </ParamField>

  ## Returns

  <ResponseField name={"connection"} type={"RealSignalConnection"}>
    Connection object with Disconnect.
  </ResponseField>

  ## Types

  ### RealSignal

  Signal object returned by Signal.new.

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

  ### RealSignalConnection

  Connection object returned by RealSignal.Connect and RealSignal.Once.

  | Name | Type | Required | คำอธิบาย |
  | - | - | - | - |
  | `Disconnect` | `() -> ()` | Yes | Disconnects the connection. |

  ## ตัวอย่าง

  Connect a callback that runs at most once.

  ```lua theme={null}
  local signal = Signal.new()

  signal:Once(function(value)
      print(value)
  end)

  signal:Fire("first")
  signal:Fire("second")
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.