NativeScript 9.1 Released → V8 14.9, Vite 8 HMR, built for rapid agentic visual iteration
Dig in
ts
function executeOnMainThread(func: Function): any;

Defined in: utils/index.d.ts:55

Checks if the current thread is the main thread. Directly calls the passed function if it is, or dispatches it to the main thread otherwise.

Parameters ​

ParameterTypeDescription
funcFunctionThe function to execute on the main thread.

Returns ​

any