Cypress_TS/CyLukTs/lukan/node_modules/throttleit
Lukáš Kaňka ea3e372146 údržba
2023-08-15 18:35:50 +02:00
..
.npmignore údržba 2023-08-15 18:35:50 +02:00
component.json údržba 2023-08-15 18:35:50 +02:00
example.js údržba 2023-08-15 18:35:50 +02:00
History.md údržba 2023-08-15 18:35:50 +02:00
index.js údržba 2023-08-15 18:35:50 +02:00
Makefile údržba 2023-08-15 18:35:50 +02:00
package.json údržba 2023-08-15 18:35:50 +02:00
Readme.md údržba 2023-08-15 18:35:50 +02:00
test.js údržba 2023-08-15 18:35:50 +02:00

throttle

Throttle a function

Installation

$ component install component/throttle

Example

var throttle = require('throttle');
window.onresize = throttle(resize, 200);

function resize(e) {
  console.log('height', window.innerHeight);
  console.log('width', window.innerWidth);
}

API

throttle(fn, wait)

Creates a function that will call fn at most once every wait milliseconds.

Supports leading and trailing invocation.

fn will receive last context (this) and last arguments passed to a throttled wrapper before fn was invoked.

License

MIT