Fix key input in web wasm build (avoid creating two instances)
<script>
window.addEventListener('load', function () {
- // the `wasm_bindgen` global is set to the exports of the Rust module
- const { start } = wasm_bindgen;
-
- // we'll defer our execution until the wasm is ready to go
- function run() {
- start();
- }
-
- // here we tell bindgen the path to the wasm file so it can run
- // initialization and return to us a promise when it's done
wasm_bindgen('./web_bg.wasm')
- .then(run)
.catch(console.error);
})
</script>
