Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

function-tools

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-tools - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

1

example/throttle.js

@@ -0,1 +1,2 @@

"use strict";
var f = require("../");

@@ -2,0 +3,0 @@

@@ -7,2 +7,6 @@ "use strict";

@alias f
@example
```js
var f = require("function-tools");
```
*/

@@ -14,5 +18,11 @@ exports.throttle = throttle;

@param {Function} - the function to throttle
@param {Object} - options
@param [options] {Object} - the options
@param [options.restPeriod] {number} - a value in ms
@returns {Function}
@alias module:function-tools.throttle
@example
```js
var throttled = f.throttle(myFunction, { restPeriod: 200 });
throtted(); // this will only execute if at least 200ms since the last invocation
```
*/

@@ -36,3 +46,3 @@ function throttle(f, options){

}
}
};
}

8

package.json
{
"name": "function-tools",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "0.1.0",
"version": "0.1.1",
"description": "Useful higher-order functions",

@@ -11,3 +11,5 @@ "repository": "https://github.com/75lb/function-tools.git",

},
"keywords": [],
"keywords": [
"throttle"
],
"engines": {

@@ -22,5 +24,5 @@ "node": ">=0.10.0"

"devDependencies": {
"jsdoc-to-markdown": "^0.1.9",
"jsdoc-to-markdown": "^0.5",
"tape": "^2.13.3"
}
}

@@ -6,42 +6,27 @@ [![view on npm](http://img.shields.io/npm/v/function-tools.svg)](https://www.npmjs.org/package/function-tools)

<a name="module_function-tools"></a>
#function-tools
Useful higher-order functions
**Example**
```js
var f = require("function-tools");
```
**Contents**
* [throttle(f, options)](#module_function-tools.throttle)
<a name="module_function-tools.throttle"></a>
###f.throttle(f, options)
##f.throttle(f, [options])
Guarantees a function a specified `restPeriod` in between invocations.
**Params**
- f `function` the function to throttle
- options `Object` options
- f `function` - the function to throttle
- \[options\] `Object` - the options
- \[restPeriod\] `number` - a value in ms
**Returns**: `function`
**Example**
```js
var throttled = f.throttle(myFunction, { restPeriod: 200 });
throtted(); // this will only execute if at least 200ms since the last invocation
```
**Returns**: `function`

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc