event-loop
event-loop copied to clipboard
Fixing microtasks and fleshing out raf
The diff is bad since I changed the indenting so it'd syntax highlight as JS.
Summary:
- Changed
executeMicrotasksto execute until the list is empty, including any additional items added. - Added
executeJSCallbackwhich should be called for all JS callbacks, including those from tasks, but there isn't really a way to express this. - Added
executeRequestAnimationFrameCallbacksto show that additional callbacks queued will happen in the next turn around the render loop.
I've split out the reindenting commit. The actual changes are at https://github.com/atotic/event-loop/pull/3/commits/9427d9b3f929d96aa9ca58e0d8031b7fdd3abf4f
probably a tad easier to review without the whitespace changes: ?w=1
TIL about ?w=1!
However, I split out the commits, so you can also see https://github.com/atotic/event-loop/commit/9427d9b3f929d96aa9ca58e0d8031b7fdd3abf4f.