Skip to content

Commit

Permalink
fix start bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DonutEspresso committed Jan 23, 2017
1 parent 0329a4d commit 162ace0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ function Reissue(opts) {
* @type {Function}
*/
self._nextHandlerId = null;

/**
* boolean flag set when we are waiting for user supplied function to
* complete. technically we should know this if self._nextHandlerId had
* a flag to show whether or not it had already been executed, but this is
* a safer way to do it.
* @type {Boolean}
*/
self._inUserFunc = false;
}
util.inherits(Reissue, events.EventEmitter);

Expand Down Expand Up @@ -220,7 +229,7 @@ Reissue.prototype.start = function start(delay) {
self._active = true;

if (typeof delay === 'number') {
setTimeout(function _nextInvocation() {
self._nextHandlerId = setTimeout(function _nextInvocation() {
self._execute();
}, delay);
} else {
Expand Down

0 comments on commit 162ace0

Please sign in to comment.