mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refact(utils): Resolve circular dependency without duplicating any code
This commit is contained in:
7
tns-core-modules/utils/mainthread-helper.ios.ts
Normal file
7
tns-core-modules/utils/mainthread-helper.ios.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function dispatchToMainThread(func: () => void) {
|
||||
NSOperationQueue.mainQueue.addOperationWithBlock(func);
|
||||
}
|
||||
|
||||
export function isMainThread(): Boolean {
|
||||
return NSThread.isMainThread;
|
||||
}
|
||||
Reference in New Issue
Block a user