throttleit
Advanced tools
+3
-2
| { | ||
| "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": { |
+18
-8
@@ -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 @@ |
Sorry, the diff of this file is not supported yet
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
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
2.96%43
30.3%8
-11.11%