Skip to main content

once

Callable

  • once<K>(eventName: K, listener: (...args: Parameters<K extends keyof IServerEvent ? IServerEvent[K] : K extends never ? ICustomEmitEvent[K] : never>) => void): void
  • once<K>(eventName: Exclude<K, keyof IServerEvent>, listener: (...args: any[]) => void): void

  • Subscribes to a server event with the specified listener, which only triggers once.


    Type parameters

    • K: keyof IServerEvent