bloody-every

0.0.0 • Public • Published

every

browser support

https://travis-ci.org/bloodyowl/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
every(
  function(stop){
    if(/interactive|complete|loaded/.test(document.readyState)) {
      app.init()
      stop()
    }
  },
  10,
  true
)

Dependents (0)

Package Sidebar

Install

npm i bloody-every

Weekly Downloads

1

Version

0.0.0

License

MIT

Last publish

Collaborators

  • bloodyowl