asapScheduler
is similar to queueMicroTask()
and Promise
. AsapScheduler lets you schedule work on the microtask queue, executing task as soon as possible, once all synchronous code has been executed.
Be warned though, that heavy operations within thte Microtask queue will block the UI until the queue is cleared.