Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created December 8, 2017 11:21
Show Gist options
  • Save goofmint/58b90e6ab3247fe2165a97d089d46ee0 to your computer and use it in GitHub Desktop.
Save goofmint/58b90e6ab3247fe2165a97d089d46ee0 to your computer and use it in GitHub Desktop.
var sum = null;
fetch('main.wasm')
.then((response) => response.arrayBuffer())
.then((bytes) => WebAssembly.instantiate(bytes, {}))
.then((results) => {
const instance = results.instance;
sum = instance.exports.sum;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment