Skip to content

Wraps a function with a time limit. If the function is not called by the specified time it will never call the original function and optionally call a notifier function.

Notifications You must be signed in to change notification settings

coen-hyde/ttlfn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttlfn

Wraps a function with a time limit. If the function is not called by the specified time it will never call the original function and optionally call a notifier function.

npm tag

Usage

var ttlfn = require('ttlfn');

var myfunc = ttlfn(3000, function() {
  console.log('Hello');
}, function() {
  console.log('Good bye');
});

myfunc()

setTimout(myfunc, 4000);

The above example will print.

Hello
Good Bye

About

Wraps a function with a time limit. If the function is not called by the specified time it will never call the original function and optionally call a notifier function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published