diff options
author | natrixaeria <janng@gmx.de> | 2019-05-22 20:20:16 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-22 20:20:16 +0200 |
commit | e724788ce9345f6fb049d4de447657861ac46f69 (patch) | |
tree | 26d836330e434bd07fa7574087ed7a5494160e26 /WebInterface/wasm/asm-paint/loader.js | |
parent | c3ae4cba3a1577c1ca7f86e4acd6778c6f74ffc3 (diff) |
Load the wasm
Diffstat (limited to 'WebInterface/wasm/asm-paint/loader.js')
-rw-r--r-- | WebInterface/wasm/asm-paint/loader.js | 17 |
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); + |