throttle-typescript
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

throttle-typescript

Install

You can install via npm or yarn.

npm

npm install --save throttle-typescript

yarn

yarn add throttle-typescript

Usage

You can import using ES6 imports. If you are using typescript this package includes a typings file.

import { throttle } from 'throttle-typescript';

The throttle helper takes two parameters, a function you want to throttle, and a limit (milliseconds). It will return a throttled version of that function that can be used as shown below:

function myFunction() {
	// Do the thing
}

window.addEventListener('resize', throttle(myFunction, 100));

Package Sidebar

Install

npm i throttle-typescript

Weekly Downloads

1,156

Version

1.1.0

License

MIT

Unpacked Size

200 kB

Total Files

9

Last publish

Collaborators

  • bameyrick