throttleit
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "throttleit", | ||
"description": "Throttle a function", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"keywords": [], | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/component/throttle.git" | ||
"url": "git://github.com/sindresorhus/throttleit.git" | ||
}, | ||
@@ -10,0 +11,0 @@ "devDependencies": { |
@@ -7,15 +7,25 @@ | ||
## Installation | ||
```sh | ||
$ component install component/throttle | ||
``` | ||
$ component install component/throttle | ||
```sh | ||
$ npm install throttleit | ||
``` | ||
## Example | ||
var throttle = require('throttle'); | ||
window.onresize = throttle(resize, 200); | ||
```js | ||
// with component: | ||
var throttle = require('throttle'); | ||
// with npm: | ||
// var throttle = require('throttleit'); | ||
function resize(e) { | ||
console.log('height', window.innerHeight); | ||
console.log('width', window.innerWidth); | ||
} | ||
window.onresize = throttle(resize, 200); | ||
function resize(e) { | ||
console.log('height', window.innerHeight); | ||
console.log('width', window.innerWidth); | ||
} | ||
``` | ||
## API | ||
@@ -22,0 +32,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4623
43
8