| 5 | module.exports = class SingleBar extends _GenericBar{ |
| 6 | |
| 7 | constructor(options, preset){ |
| 8 | super(_options.parse(options, preset)); |
| 9 | |
| 10 | // the update timer |
| 11 | this.timer = null; |
| 12 | |
| 13 | // disable synchronous updates in notty mode |
| 14 | if (this.options.noTTYOutput && this.terminal.isTTY() === false){ |
| 15 | this.options.synchronousUpdate = false; |
| 16 | } |
| 17 | |
| 18 | // update interval |
| 19 | this.schedulingRate = (this.terminal.isTTY() ? this.options.throttleTime : this.options.notTTYSchedule); |
| 20 | |
| 21 | // callback used for gracefulExit |
| 22 | this.sigintCallback = null; |
| 23 | } |
| 24 | |
| 25 | // internal render function |
| 26 | render(){ |