@zcorky/throttle
v1.0.0
Published
Throttle a function
Downloads
1,794
Readme
throttle
Throttle a function.
Install
$ npm install @zcorky/throttle
Usage
// import
import throttle from '@zcorky/throttle';
// throttle
function resize(e) {
console.log('width', window.innerWidth);
console.log('height', window.innerHeight);
}
window.onresize = throttle(resize, 200);