From 9c31ff1fb1261fd2a15e6f2bac0bba255e7765a7 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 22 Mar 2021 09:08:32 +0000 Subject: [PATCH] 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 --- core/modules/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 4c9c3e96d..f3167fdfa 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -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); }