blob: b222149babee955111d631f0e489e75696869078 (
plain) (
tree)
|
|
<script type="module">
import * as api from "./api-wasm.js";
WebAssembly
.instantiateStreaming(fetch("add.wasm"), { env: api })
.then(({instance: {exports}}) => {
const added = exports.add(4, 5);
console.log("Adding 4 and 5:", added);
exports.persistInt(6);
const persisted = exports.retrieveInt();
console.log("Persisted number:", persisted);
});
</script>
|