Debounced raf (requestAnimationFrame) function
$ npm install @f/raf-debounce
var rafDebounce = require('@f/raf-debounce')
var debouncedRender = rafDebounce(render)
subscribe(debouncedRender)
fn
- The function you want to call no more than once every animation frame.
Returns: A debounced version of fn
that runs only once every animation frame (at most). When called, that function returns a cancel function that can be used to cancel a pending debounce.
MIT