AP2 bugs

Tab Atkins Jr. jackalmage at gmail.com
Sat Aug 31 14:13:51 PDT 2013


On Sat, Aug 31, 2013 at 9:03 AM, Nathan Wall <nathan.wall at live.com> wrote:
> Am I correct to understand that "queue a microtask" means that the task should be run asynchronously?  For this, I am currently using a function called `defer(f)` which is just a wrapper around `setTimeout(f, 0)`.

Yes, but setTimeout is "more asynchronous" than a microtask.
Microtasks are defined by HTML I think?  Basically, a microtask is run
at the end of the current script stack, just before yielding control
to the browser.

Using setTimeout shouldn't be incorrect, but it will be slower than intended.

~TJ


More information about the es-discuss mailing list