Skip to content
Discussion options

You must be logged in to vote

I’m not very familiar with Angular, but top-level-await is a runtime feature that has been supported by all major browsers for quite some time.

The main reasons for using top-level await are:

  • The WASM loading API is asynchronous, so we need an async approach.
  • The rollout of WASM support and top-level await happened around the same time, so a runtime that lacks top-level await likely also lacks WASM support.
  • Using top-level await avoids having to wrap every function’s return value in a Promise.

The issue with a design like 7z-asm is that each time you call and await moduleLoader, it creates a new WASM instance. While an app using libxml2-wasm directly might be fine, problems can arise if…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@FlorianLeutloff
Comment options

Answer selected by FlorianLeutloff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants