A simple higher order function to throttle a function by animation frames.
npm -i -D with-raf
fn
is a function to be throttledonCall
is a callback function that is trigger oncefn
is called. It receives the return value offn
as its arguments.raf
is an option to use a polyfill forwindow.requestAnimationFrame
Returns: the animation frame-throttled version of fn
.