Like setInterval() but using requestAnimationFrame()
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig Remove unused files & add dotfiles Dec 21, 2014
.gitignore
.npmignore
.travis.yml
LICENSE
README.md Remove raf dependency Apr 9, 2016
component.json
index.js
package.json

README.md

request-interval Build Status

Like setInterval() but using requestAnimationFrame().
You can also find requestTimeout component here.

Installation

With npm do:

$ npm install request-interval --save

Install with component(1):

$ component install nk-components/request-interval

API

var requestInterval = require('request-interval');

var id = requestInterval(300, function() {
  // do something
});

// [...]
// stop
requestInterval.clear(id);

If you need to support IE9, add a polyfill for requestAnimationFrame() and cancelAnimationFrame()

License

MIT

Inspired by Joe Lambert's Gist.