aboutsummaryrefslogtreecommitdiff
path: root/tmp/index.html
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-02-12 09:04:53 -0300
committerEuAndreh <eu@euandre.org>2020-02-12 09:04:53 -0300
commitb677d3bb3d6c8fbb0b61621cc8ac53a7d68fa949 (patch)
treea3d61cd41fbbc1fa1196f6e4bdcb76c549a3f532 /tmp/index.html
parentSort pastebins listing by date (diff)
downloadeuandre.org-b677d3bb3d6c8fbb0b61621cc8ac53a7d68fa949.tar.gz
euandre.org-b677d3bb3d6c8fbb0b61621cc8ac53a7d68fa949.tar.xz
wip
Diffstat (limited to 'tmp/index.html')
-rw-r--r--tmp/index.html14
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>