JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14303
  • Score
    100M100P100Q136138F
  • License MIT

Throttle a function by requestAnimationFrame

Package Exports

  • raf-throttle

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (raf-throttle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

raf-throttle

Throttle a function by requestAnimationFrame

npm Travis Coveralls Code Climate

raf-throttle let you create a throttled function, which only invokes the passed function at most once per animation frame on a browser or per 1000/60 ms on Node.

Installation

npm install raf-throttle --save

Usage

import throttle from 'raf-throttle'

const throttled = throttle(updatePosition)
window.addEventListener('scroll', throttled)

Contributing

Issues and PRs are all welcome.