npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

raf-debounce

0.1.1

@rauchg

npmSnykSocket
Downloads:0
$ npm install raf-debounce
DailyWeeklyMonthlyYearly

raf-debounce

Debounces the execution of a function until the next animation frame.

The supplied function gets called only once. The last arguments supplied to the debounced function will be used, which can be called multiple times.

How to use

import debounce from 'raf-debounce';
const paint = debounce(function(val){
  document.body.innerHTML = val;
});
window.onmousemove = function(){
  paint(ev.clientX);
}