Created
May 5, 2019 10:55
-
-
Save fvilches17/49c4a33e3cf7d5b8d56a819a6c81ff83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleGreetButtonClickEvent(event) { | |
event.preventDefault(); | |
const { greet } = await import('../src/hello_world/pkg'); | |
greet(); //When greet() is called, .wasm will update the <h1> title in index.html | |
} | |
document.querySelector('#btn-greet').onclick = handleGreetButtonClickEvent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment