Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 409 Bytes

Readme.md

File metadata and controls

33 lines (19 loc) · 409 Bytes

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