raf-listen

Call a function at most once per animation frame


Keywords
raf, throttle, event, listen, debounce, animation, frame
License
ISC
Install
npm install raf-listen@1.0.0

Documentation

raf listen

js-standard-style

Call a function at most once per animation frame.

Featuring:

  • commonjs
  • no es6

install

$ npm install raf-listen

example

var throttle = require('raf-listen')
// polyfill raf if you want
require('raf').polyfill()

setInterval(function () {
  console.log('unthrottled')
}, 5)

setInterval(throttle(function () {
  console.log('throttled')
}), 5)