3 ms·
It might be better to use two calls. First call requestAnimationFrame and in the first callback, set the column and make a second rAF or rIC call. In the second
by nfriedly 8y ago
It might be better to use two calls. First call requestAnimationFrame and in the first callback, set the column and make a second rAF or rIC call. In the second callback, do your sorting.
Also, it should be possible to do the sorting in a way that mostly doesn't block the browser. The data itself (if it lives outside of the DOM) can be sorted in a web worker. The DOM obviously blocks the UI thread, but you could do small batches of changes with a rAF or a rIC in-between each.
Or, you know, just stick with setTimeout(..., 0) since that's already working for you.