mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +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 */
|
/*global window: false */
|
||||||
if(typeof process === "undefined") {
|
if(typeof process === "undefined") {
|
||||||
// Apparently it would be faster to use postMessage - http://dbaron.org/log/20100309-faster-timeouts
|
// Apparently it would be faster to use postMessage - http://dbaron.org/log/20100309-faster-timeouts
|
||||||
window.setTimeout(fn,4);
|
window.setTimeout(fn,0);
|
||||||
} else {
|
} else {
|
||||||
process.nextTick(fn);
|
process.nextTick(fn);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user