Clone in a terminal:
loader.js
examples/callbacks/ - Four spaces for tabs
let wasmModule;

async function loadWasm() {
    try {
        const wasmModule = await import("./main.js");
        await wasmModule.default("./main_bg.wasm");

        return wasmModule;
    } catch (error) {
        console.error("Failed to load WASM module:", error);
    }

    return null;
}

window.addEventListener("DOMContentLoaded", async () => {
    wasmModule = await loadWasm();
});

File history (2 commits)

709ebd2 Johan Mattsson - johan.mattsson.m@gmail.com
Four spaces for tabs
Four spaces for tabs
760267c Johan Mattsson - johan.mattsson.m@gmail.com
Update example
Update example

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112