lib/dispatcher.js
function schedule(actionName) {
      timeout.clear();
      var timeoutMS = timeout.timeoutMS(actionName);
      log.debug({ actionName: actionName, timeoutMS: timeoutMS }, 'schedule');
      var args = { actionName: actionName, isPaused: _isPauseTriggered(timeoutMS) };
      if (timeoutMS > 0) return setTimeout(function () {
        return execute(args);
      }, timeoutMS);
      execute(args);
    }
function schedule(actionName) {
      timeout.clear();
      var timeoutMS = timeout.timeoutMS(actionName);
      log.debug({ actionName: actionName, timeoutMS: timeoutMS }, 'schedule');
      var args = { actionName: actionName, isPaused: _isPauseTriggered(timeoutMS) };
      if (timeoutMS > 0) return setTimeout(function () {
        return execute(args);
      }, timeoutMS);
      execute(args);
    }
function schedule ( actionName ) { timeout . clear ( ) ; var timeoutMS = timeout . timeoutMS ( actionName ) ; log . debug ( { actionName : actionName , timeoutMS : timeoutMS } , 'schedule' ) ; var args = { actionName : actionName , isPaused : _isPauseTriggered ( timeoutMS ) } ; if ( timeoutMS > 0 ) return setTimeout ( function ( ) { return execute ( args ) ; } , timeoutMS ) ; execute ( args ) ; }
Responsible for clearing old timeout and scheduling new one or immediately executing, returns new timeoutID or undefined
Responsible for clearing old timeout and scheduling new one or immediately executing returns new timeoutID or undefined