refact(utils): Check current thread and dispatch only if needed

This commit is contained in:
Martin Bektchiev
2019-05-08 14:22:06 +03:00
parent c60f74d4eb
commit a2ef6cbb4b
5 changed files with 29 additions and 5 deletions

View File

@@ -159,7 +159,7 @@ export function openUrl(location: string): boolean {
return false;
}
export function executeOnMainThread(func: () => void) {
export function dispatchToMainThread(func: () => void) {
NSOperationQueue.mainQueue.addOperationWithBlock(func);
}