Closed yisar closed 3 years ago
I don't think your understanding of rAF is correct.
Promise.resolve().then(() => {
console.log('micro')
requestAnimationFrame(() => {
console.log('raf')
})
setTimeout(() => {
console.log('timeout')
}, 0)
}).then(() => {
console.log('chained micro')
})
The output will be
There's just no way rAF can be used for "synchronous" time slicing.
Closing since I don't think this is actually feasible unless a prototype can prove otherwise.
This is a time slicing implement way suitable for Vue, which can effectively alleviate Jank.
It's very intrusive, the same as the current behavior, and it's coarse-grained and doesn't sacrifice the time of the microtask.
Thank you~
rerendered