Skip to content

A simple way to ensure that a function does not run more often than specified

Notifications You must be signed in to change notification settings

sealcode/simple-throttler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-throttler

What it is

A simple function that ensures that another function does not run too often. Subsequent calls will be delayed so they meet the criteria.

Usage

var Throttler = require("simple-throttler");

var t = Throttler(1000);

t(()=>console.log("1"));
t(()=>console.log("2")); // will run after 1s
t(()=>console.log("3")); // will run after 2s

About

A simple way to ensure that a function does not run more often than specified

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published