diff options
Diffstat (limited to 'tmp/index.html')
-rw-r--r-- | tmp/index.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tmp/index.html b/tmp/index.html new file mode 100644 index 0000000..b222149 --- /dev/null +++ b/tmp/index.html @@ -0,0 +1,14 @@ +<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> |