1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 10:57:05 +00:00

Iris + WebAssemply = = 💓

Former-commit-id: 44f08f112cfba8006d2a6fe34e32b24e5c246856
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-07-09 09:13:36 +03:00
parent 0297afdc6b
commit cd5109ae0e
9 changed files with 485 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import './go-wasm-runtime.js';
if (!WebAssembly.instantiateStreaming) { // polyfill
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}
const go = new Go();
WebAssembly.instantiateStreaming(fetch("hello.wasm"), go.importObject).then((result) => {
return WebAssembly.instantiate(result.module, go.importObject);
}).then(instance => go.run(instance));