feat(core): queueMacroTask (#8904)

This commit is contained in:
Eduardo Speroni
2020-11-12 00:52:29 -03:00
committed by GitHub
parent c1f231d88e
commit e3dc89fbfc
6 changed files with 91 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
import { dip, px } from '../ui/core/view';
export * from './mainthread-helper';
export * from './macrotask-scheduler';
export { Source } from './debug';
export * from './native-helper';
@@ -192,6 +193,12 @@ export function GC();
*/
export function releaseNativeObject(object: any /*java.lang.Object | NSObject*/);
/**
* Queues the passed function to be ran in a macroTask
* @param task the function to execute as a macroTask
*/
export function queueMacrotask(task: () => void): void;
/**
* 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.