lib/utils.js
function setTimeoutContext(fn, ctx, timeout) {
  var id;

  var cancel = function() {
    clearTimeout(id);
  };

  id = setTimeout(function() {
    ctx.removeListener('cancel', cancel);

    fn();
  }, timeout);

  ctx.once('cancel', cancel);
}
function setTimeoutContext(fn, ctx, timeout) {
  var id;

  var cancel = function() {
    clearTimeout(id);
  };

  id = setTimeout(function() {
    ctx.removeListener('cancel', cancel);

    fn();
  }, timeout);

  ctx.once('cancel', cancel);
}
function setTimeoutContext ( fn , ctx , timeout ) { var id ; var cancel = function ( ) { clearTimeout ( id ) ; } ; id = setTimeout ( function ( ) { ctx . removeListener ( 'cancel' , cancel ) ; fn ( ) ; } , timeout ) ; ctx . once ( 'cancel' , cancel ) ; }
Set timeout with cancel support
Set timeout with cancel support