forked from visionmedia/node-progress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The config method allows the progress bar to be reconfigured at any point, such as from the callback. Also changed the order so that the callback is called before the final render, so that the callback can reconfigure the bar for the final render.
- Loading branch information
Showing
3 changed files
with
57 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var ProgressBar = require('..'); | ||
|
||
var bar = new ProgressBar(' [:bar]', { | ||
complete: '=', | ||
incomplete: '-', | ||
total: 20, | ||
callback: function () { | ||
bar.config({ complete: '▓' }); | ||
} | ||
}); | ||
|
||
var id = setInterval(function (){ | ||
bar.tick(); | ||
if (bar.complete) { | ||
clearInterval(id); | ||
} | ||
}, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters