Add a flush() function to Terminal

Reviewed By: yungsters

Differential Revision: D6713011

fbshipit-source-id: 05afd49e4099301124d83e1b345d7b40a9c84c73
This commit is contained in:
Adam Ernst 2018-01-12 13:00:51 -08:00 committed by Facebook Github Bot
parent 5d3581e795
commit 2e34f6f9a8
1 changed files with 7 additions and 0 deletions

View File

@ -169,6 +169,13 @@ class Terminal {
this.log(this._nextStatusStr); this.log(this._nextStatusStr);
this._nextStatusStr = ''; this._nextStatusStr = '';
} }
flush(): void {
// Useful if you're going to start calling console.log/console.error directly
// again; otherwise you could end up with mangled output when the queued
// update starts writing to stream after a delay.
this._scheduleUpdate.flush();
}
} }
module.exports = Terminal; module.exports = Terminal;