mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-27 18:40:28 +00:00
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
This commit is contained in:
parent
a44a8c31f0
commit
9c31ff1fb1
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user