JSFiddle - React, Tailwind, and code Playground
JavaScript
jQuery(function($) {
// [something] is a flag which is modified by some other scripts
var something = false,
foo = function() {
if (something == true) {
// do stuff
// blah blah
// pop! bang!
// backflips! tumblings!
//
// ...
//
}
// schedule another run of this function
setTimeout(foo, 1000);
};
// start the first iteration
setTimeout(foo, 1000);
}