summaryrefslogtreecommitdiff
path: root/webhogg/wasm/pkg/worker.js
blob: bd116763e66d7ef4fad70f24adb383b9a04924e6 (plain)
1
2
3
4
5
6
7
8
9
onmessage = async function (e) {
    importScripts('../bin/webhogg-wasm.js');
    let ctx = await wasm_bindgen(e.data[1]);

    if (e.data[0] === 'graphics')
        ctx.start_graphics();
    else if (e.data[0] === 'logic')
        ctx.start_logic();
}