0.3.0
What's Changed
- Asynchronous input methods via
inputconfiguration by @anderoonies in #137
Asynchronous Input
0.3.0 changes the public API of the Console class. It is now configured with input, output, and clear.
input configures how the asynchronous input methods readLineAsync, readIntAsync, readFloatAsync, and readBooleanAsync receive input. In CodeHS, they receive input via the postMessage API, but the docs have some examples of how you might implement input with an input element. Blocking input with prompt is, for better or worse, the expectation for how many CodeHS programs work, so configuring the default readLine behavior isn't an important option.
output configures how print and println emit output. By default this is console.log, but you can configure it however you'd like. This replaces the previous onPrint option.
clear configures how clear functions. By default this is console.clear. This replaces the previous onClear option.
To read more about asynchronous input, check out this tutorial.
Full Changelog: 0.2.22...0.3.0