Skip to content

Commit

Permalink
run render if throttle is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed May 7, 2017
1 parent d84326e commit f37469e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/node-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ ProgressBar.prototype.tick = function(len, tokens){
this.curr += len

// schedule render
if (!this.renderThrottleTimeout) {
if (this.renderThrottle === 0) {
this.render();
} else if (!this.renderThrottleTimeout) {
this.renderThrottleTimeout = setTimeout(this.render.bind(this), this.renderThrottle);
}

Expand Down

0 comments on commit f37469e

Please sign in to comment.