9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement
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