web/public/obj/js/updateLoop.js

15 lines
353 B
JavaScript

window.updateLoop = [];
(() => {
let updLoop = setInterval(() => {
updateLoop.forEach(f => f());
}, 30000);
let everythingLoaded = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
clearInterval(everythingLoaded);
updateLoop.forEach(f => f());
}
}, 10);
})();