Tbh, it's pretty ridiculous that most browsers don't have a `process.nextTick()` equivalent. `setImmediate()` was meant to be this, but instead we're all stuck writing `setTimeout(cb, 0)`. We should be better than this. https://caniuse.com/#feat=setimmediate …
Okay, so not quite - `requestAnimationFrame` triggers paints, and is (usually) capped at 60 times a second. It also triggers GC. setTimeout(cb, 0) can trigger every 3ms (so 5x as often), doesn't trigger paints and doesn't seem to trigger GC. RAF seems for rendering things.
-
-
I think from a practical perspective we can safely ignore this. I think for me it's mostly about intent. In a way having explicit access to the microtask API might be the answer here.
-
The lib I linked in my other response uses RAF then setImmediate. But I think your point is good. To be more accurate it should reverse that.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.