MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / executeOnMainThread

Function executeOnMainThread

packages/core/utils/common.ts:163–169  ·  view source on GitHub ↗
(func: Function)

Source from the content-addressed store, hash-verified

161}
162
163export function executeOnMainThread(func: Function) {
164 if (isMainThread()) {
165 return func();
166 } else {
167 dispatchToMainThread(func);
168 }
169}
170
171export function executeOnUIThread(func: Function) {
172 dispatchToUIThread(func);

Callers 1

mainThreadifyFunction · 0.85

Calls 3

isMainThreadFunction · 0.90
dispatchToMainThreadFunction · 0.90
funcFunction · 0.85

Tested by

no test coverage detected