Skip to content

webmodules/raf-debounce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published