debounce-raf
Debounce function until next requestAnimationFrame. Auto cancel all extraneous calls between frames
Usage
const raf = const render = // Called every 4ms, but will only render efter animation frame, with the latest// call
API
var debouncedFn = raf(fn)
Debounce fn
to every animation frame. Cancel all calls in between. Will
forward any args passed to debouncedFn
onto fn
.
Install
npm install debounce-raf