by Promarged · 8y ago · 0 comments
fetch('../out/main.wasm').then(response =>
response.arrayBuffer()
).then(bytes => WebAssembly.instantiate(bytes))
could be expressed as this: fetch('../out/main.wasm').then(response =>
WebAssembly.instantiateStreaming(response))
[0]: https://hacks.mozilla.org/2018/01/making-webassembly-even-fa... fetch('../out/main.wasm').then(response =>
WebAssembly.instantiateStreaming(response.arrayBuffer()))
Otherwise it could just be: fetch('../out/main.wasm').then(WebAssembly.instantiateStreaming)