Back to Wails

Function Once

v3/internal/runtime/desktop/@wailsio/runtime/docs/functions/Events.Once.html

2.13.0839 B
Original Source

Function Once

Once<E extends string & {} = string & {}>(
eventName: E,
callback: WailsEventCallback<E>,
): () => void

Registers a callback function to be executed only once for the specified event.

Type Parameters

  • E extends string & {} = string & {}

Parameters

  • eventName: E

The name of the event to register the callback for.

The callback function to be called when the event is triggered.

Returns () => void

A function that, when called, will unregister the callback from the event.

Settings

Member Visibility

  • Protected
  • Inherited
  • External

ThemeOSLightDark