onestopjs

by Martin Koparanov

0%

Vintage clock

debounce-animation-frame


Small package for debouncing your functions using requestAnimationFrame.

Check it out on GitHub/npm.
There is also a React hook for it: GitHub/npm

Why it exists

If you have a fast-changing value and you have visualizations depending on it, it may get expensive to run your rendering logic every time the value changes.
This package ensures that your function will be called no more often than whatever can be seen.