v3.0.0 "JS API Is Now `async`/`await` Compatible But Everything Else Is Literally The Same"
To call asynchronous functions in the JS API, instead of this:
Hudkit.getMonitorLayout((e, monitors) => {
// do stuff with `monitors`
})
you now do this:
const monitors = await Hudkit.getMonitorLayout()
Same for Hudkit.showInspector
and Hudkit.setClickableAreas
. The readme has been updated accordingly.
Until WebKit starts supporting the TC39 top-level await
standard proposal, this means you have to wrap your whole thing in an async function, so if you're getting a SyntaxError
, see my new addition to the FAQ.
That is all. Bumped the major version number just for this, because it is an API break even though nothing particularly substantive has changed.