Like setInterval() but with requestAnimationFrame()
npm install request-intervalLike setInterval() but using requestAnimationFrame().
You can also find requestTimeout component here.
With npm do:
``bash`
$ npm install request-interval --save
Install with component(1):
``
$ component install nk-components/request-interval
`js
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()`
MIT
Inspired by Joe Lambert's Gist.