Closed briancavalier closed 9 years ago
:+1:
Hi, I was wondering why MutationObserver has been used to get nextTick. I think for performance in browser enviroment over setTimeout. If so, why not using window.requestAnimationFrame?
Hi @marcog83. MutationObserver
, when available, is the fastest microtick approach in browsers (faster than requestAnimationFrame
).
+1000, this kind of knowledge let you be the fastest in terms of performance :)
HT tildeio/rsvp.js#171
Apparently, MO polyfills might not trigger when setting an attribute to the same value. This change uses a bit flip to alternate between 0 and 1.