rust-webwasm/index.js
2023-11-19 01:45:09 -08:00

12 lines
346 B
JavaScript

import wasmInit from "./pkg/gamarjoba.js"
const runWasm = async () => {
const rustWasm = await wasmInit("./pkg/gamarjoba_bg.wasm");
const result = rustWasm.de_iavascriptis(0, 1);
console.log("Should be undefined: ", rustWasm.add_integer_with_constant);
document.body.textContent = `Gamarjoba! result: ${result}`;
};
runWasm();