Created
February 11, 2019 23:09
-
-
Save stenno/e09c2b37fb15244fcf11256c5f910079 to your computer and use it in GitHub Desktop.
async generator example
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
async doANSIInput(data) { | |
this.session.prepareForInput(); | |
const terminal = await this.session.rawInput(data, WAITING_DELAY); | |
const ANSIWindow = terminal.getANSICells(); | |
return ANSIWindow; | |
} | |
async* batchANSIInput(commands) { | |
for (const data of commands) { | |
yield await this.doANSIInput(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment