Skip to content

v3.0.0 "JS API Is Now `async`/`await` Compatible But Everything Else Is Literally The Same"

Compare
Choose a tag to compare
@anko anko released this 21 Feb 19:15
· 39 commits to master since this release

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.