Skip to content

Instantly share code, notes, and snippets.

@LaylBongers
Created September 27, 2018 14:48
Show Gist options
  • Save LaylBongers/20be93ccee03595096c2a297dd36a040 to your computer and use it in GitHub Desktop.
Save LaylBongers/20be93ccee03595096c2a297dd36a040 to your computer and use it in GitHub Desktop.
/******/ // Fetch + compile chunk loading for webassembly
/******/
/******/ var wasmModules = {"0":["./wasm/artist_page_webapp_client_bg.wasm"]}[chunkId] || [];
/******/
/******/ wasmModules.forEach(function(wasmModuleId) {
/******/ var installedWasmModuleData = installedWasmModules[wasmModuleId];
/******/
/******/ // a Promise means "currently loading" or "already loaded".
/******/ if(installedWasmModuleData)
/******/ promises.push(installedWasmModuleData);
/******/ else {
/******/ var importObject = wasmImportObjects[wasmModuleId]();
/******/ var req = fetch(__webpack_require__.p + "" + {"./wasm/artist_page_webapp_client_bg.wasm":"80803707a71eaf33a6be"}[wasmModuleId] + ".module.wasm");
/******/ var promise;
/******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') {
/******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {
/******/ return WebAssembly.instantiate(items[0], items[1]);
/******/ });
/******/ } else if(typeof WebAssembly.instantiateStreaming === 'function') {
/******/ promise = WebAssembly.instantiateStreaming(req, importObject);
/******/ } else {
/******/ var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });
/******/ promise = bytesPromise.then(function(bytes) {
/******/ return WebAssembly.instantiate(bytes, importObject);
/******/ });
/******/ }
/******/ promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {
/******/ return __webpack_require__.w[wasmModuleId] = (res.instance || res).exports;
/******/ }));
/******/ }
/******/ });
/******/ return Promise.all(promises);
/******/ };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment