throttleme

1.0.3 • Public • Published

throttleme

NPM

Usage

var throttle = require('throttleme')
var now = Date.now()
 
var fast = function (/* whatever args */) {
  console.log(Date.now() - now)
}
 
var slow = throttle(fast, 200)
 
// Note: you won't get exactly 0, 200, etc, because this module 
// uses setTimeout, which is inaccurate (and this module isn't that sophisticated)
// Expect something like ~20ms accuracy
 
slow() // -> 0
slow() // -> 200
slow() // -> 400
slow() // -> etc.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    4
  • 1.0.2
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i throttleme

Weekly Downloads

2

Version

1.0.3

License

ISC

Last publish

Collaborators

  • spwilko
  • genevayngrib
  • pgmemk
  • tenaciousmv