I'm ignorant on this so forgive me, but doesn't requestAnimationFrame kind of cover what you're after?
-
-
-
Maybe?
- 3 more replies
New conversation -
-
-
rIC should do it, but only in FF and Chrome, right? https://caniuse.com/#feat=requestidlecallback …
-
Nope, not quite - RIC is meant to resolve at the end of a frame, if there's time. We could set a timeout 0 for it, but that's the same level of hacks as setting a timer to resolve on next tick. A method to make something explicitely async would be great.
- 1 more reply
New conversation -
-
-
to really dive into this weirdness, i'd love to see this post updated with requestAnimationFrame and requestIdleCallback! :D https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/ …
-
Heh, yeah that'd be cool! Also having explicit access to schedule things as microtasks would be amazing. (e.g. this is too much of a hack, haha https://github.com/yoshuawuyts/nanotask …)
End of conversation
New conversation -
-
-
better shims use mutation observers or postMessage to push handlers onto the event loop
-
postMessage makes sense. Any examples of mutation observers for this?
- 2 more replies
New conversation -
-
-
Promise.resolve().then(()=> work()) Gets very close with modern browsers
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I made a little lib for this a long time back, but I agree, should be in the browser because even this umplementation is not *actually* next tick. https://github.com/wesleytodd/browser-next-tick …
-
Lol, phone misspelling. Umplimentation is a pretty good description of it though.
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.