Skip to content

runEventLoop

runEventLoop(args?): Promise<unknown>

Defined in: api/node/typescript/index.ts:771

Spins the Slint event loop and returns a promise that resolves when the loop terminates.

If the event loop is already running, then this function returns the same promise as from the earlier invocation.

Function | { quitOnLastWindowClosed?: boolean; runningCallback?: Function; }

As Function it defines a callback that’s invoked once when the event loop is running.

Function


{ quitOnLastWindowClosed?: boolean; runningCallback?: Function; }

As Function it defines a callback that’s invoked once when the event loop is running.

boolean

if set to true the loop quits once the last window is closed and the last visible system tray icon is hidden; otherwise it runs until quitEventLoop is called. A visible SystemTrayIcon keeps the loop alive on its own under the default, so set this to false only when an application must run without any visible UI. (default true).

Note that the event loop integration with Node.js is slightly imperfect. Due to conflicting implementation details between Slint’s and Node.js’ event loop, the two loops are merged by spinning one after the other, at 16 millisecond intervals. This means that when the application is idle, it continues to consume a low amount of CPU cycles, checking if either event loop has any pending events.

Function

Optional callback that’s invoked once when the event loop is running. The function’s return value is ignored.

Promise<unknown>


© 2026 SixtyFPS GmbH