1.1.1 • Published 6 years ago
with-raf v1.1.1
Higher Order Function for requestAnimationFrame Throttling
A simple higher order function to throttle a function by animation frames.
Install
npm -i -D with-rafAPI
withRaf(fn, onCall, raf = window.requestAnimationFrame)
fnis a function to be throttledonCallis a callback function that is trigger oncefnis called. It receives the return value offnas its arguments.rafis an option to use a polyfill forwindow.requestAnimationFrame
Returns: the animation frame-throttled version of fn.