Skip to content

nk-components/request-interval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Like setInterval() but using requestAnimationFrame()

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors