npm.io
1.0.0 • Published 8 years ago

@zcorky/throttle

Licence
MIT
Version
1.0.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0

throttle

NPM version Coverage Status Dependencies Build Status license issues

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);
Relatived