@ngard/tiny-throttle
v1.1.0
Published
A minimal-weight utility similar to lodash.throttle
Downloads
9
Readme
tiny-throttle
A minimal utility similar to lodash.throttle
. For when every byte counts!
lodash.throttle: tiny-throttle:
Install
npm install @ngard/tiny-throttle
Syntax
throttle(/* function, interval */);
Parameters
function
- The function to be throttled.
interval
- The amount of time, in milliseconds, to wait between invocations of the function. All function calls made during this interval are ignored.
Returns
A throttled function.
Example
import { throttle } from '@ngard/tiny-throttle';
window.addListener('scroll', throttle(animateSomething, 16));