summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/loader.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebInterface/wasm/asm-paint/loader.js')
-rw-r--r--WebInterface/wasm/asm-paint/loader.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/WebInterface/wasm/asm-paint/loader.js b/WebInterface/wasm/asm-paint/loader.js
new file mode 100644
index 0000000..8348c35
--- /dev/null
+++ b/WebInterface/wasm/asm-paint/loader.js
@@ -0,0 +1,17 @@
+console.log('js> create import object');
+let importObject = { imports: { imported_func: arg => console.log(arg) } };
+
+console.log('js> create fetch object');
+
+let asm_paint_bg = fetch('asm_paint_bg.wasm');
+
+console.log('js> instantiate streaming');
+
+function and_then(obj) {
+ console.log('js> reached instantiate streaming\'s then');
+ return obj.instance.exports.exported_func();
+}
+
+WebAssembly.instantiateStreaming(asm_paint_bg, importObject)
+ .then(and_then);
+