mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
feat: added Utils.executeOnUIThread
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import * as types from './types';
|
||||
import { dispatchToMainThread, isMainThread } from './mainthread-helper';
|
||||
import { dispatchToMainThread, dispatchToUIThread, isMainThread } from './mainthread-helper';
|
||||
import { sanitizeModuleName } from '../ui/builder/module-name-sanitizer';
|
||||
import * as layout from './layout-helper';
|
||||
|
||||
@ -125,6 +125,10 @@ export function executeOnMainThread(func: Function) {
|
||||
}
|
||||
}
|
||||
|
||||
export function executeOnUIThread(func: Function) {
|
||||
dispatchToUIThread(func);
|
||||
}
|
||||
|
||||
export function mainThreadify(func: Function): (...args: any[]) => void {
|
||||
return function (...args) {
|
||||
const argsToPass = args;
|
||||
|
Reference in New Issue
Block a user