every
install
$ npm install bloody-every
require
var every = require("bloody-every")
api
every(fn, time[, immediate])
runs fn
every time
milliseconds.
the optional immediate
boolean makes the
first run as soon as possible.
fn
receives a stop
function as first argument,
and it definitely stops the loop.
example
// starts the app and stops iterating when the DOM is ready