Skip to content

component/timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timeout

Timeout function decorator

Installation

$ component install component/timeout

Example

var timeout = require('timeout');

function something(fn) {
  setTimeout(function(){
    fn(null, 'results');
  }, 1000);
}


something = timeout(something, 500);

API

timeout(callback, ms)

Apply timeout of ms to callback and return the new function.

License

MIT

About

Timeout function decorator

Resources

Stars

Watchers

Forks

Packages

No packages published