cooled
1.1.0 • Public • Published cooled
Make function with a cooldown to avoid too Frequent call
Installation
Api
cooled(func, timeLimit)
Usage
var cooled = require('cooled')
var fn = cooled(function() {
}, 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
Package Sidebar
Install
Weekly Downloads