mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-15 09:40:52 +00:00
While it doesn't happen right now in this particular example, `lastPtr` can be potentially overridden several times before the module is fully initialised. Rather than having a boolean and a storage for one last argument, `await` a promise returned from `wasm_bindgen` itself in the new `onmessage` handler before executing actual command. This way all the potential tasks will queue up naturally, wait for the initialisation, and then execute in a correct order.
Examples
This directory contains a number of Cargo projects that are all examples of how
to use wasm-bindgen
in various contexts. More documentation can be found
online