cooled

1.1.0 • Public • Published

cooled

NPM version Downloads Dependency Status

Make function with a cooldown to avoid too Frequent call

Installation

npm i cooled

Api

cooled(func, timeLimit)

Usage

var cooled = require('cooled')
 
var fn = cooled(function() {
    // do something
}, 1000)
 
setInterval(fn, 20)

Advanced

The function returned can be called with arguments

var fn = cooled(function() {
    console.log(this, arguments)
}, 1000)
 
fn.call({foo: 'bar'}, 1, 2)

License

License

Readme

Keywords

Package Sidebar

Install

npm i cooled

Weekly Downloads

0

Version

1.1.0

License

ISC

Last publish

Collaborators

  • ftft1885