Skip to content

Instantly share code, notes, and snippets.

@fvilches17
Created May 5, 2019 10:55
Show Gist options
  • Save fvilches17/49c4a33e3cf7d5b8d56a819a6c81ff83 to your computer and use it in GitHub Desktop.
Save fvilches17/49c4a33e3cf7d5b8d56a819a6c81ff83 to your computer and use it in GitHub Desktop.
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