Skip to content

Instantly share code, notes, and snippets.

@josephwegner
Forked from jessepollak/instaInterval.js
Last active December 30, 2015 02:29
Show Gist options
  • Save josephwegner/7763301 to your computer and use it in GitHub Desktop.
Save josephwegner/7763301 to your computer and use it in GitHub Desktop.
//Or, if you don't want messy code every time, just define an instaInterval function
function instaInterval(f, t) {
return (function() {
f();
return setInterval(f, t);
});
}
//And now create executable intervals on the fly
var interval = instaInterval(function() {
console.log("This is possible the best version of setInterval");
}, 5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment