Use window.setTimeout(fn,0) for $tw.utils.nextTick in the browser

It seems that best practice has now moved to using zero:

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
publishing-framework
jeremy@jermolene.com 2021-03-22 09:08:32 +00:00
rodzic a44a8c31f0
commit 9c31ff1fb1
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -618,7 +618,7 @@ exports.nextTick = function(fn) {
/*global window: false */
if(typeof process === "undefined") {
// Apparently it would be faster to use postMessage - http://dbaron.org/log/20100309-faster-timeouts
window.setTimeout(fn,4);
window.setTimeout(fn,0);
} else {
process.nextTick(fn);
}