website/js/flox/wasm.ts

11 lines
280 B
TypeScript
Raw Permalink Normal View History

2024-09-08 15:38:21 +02:00
import * as wasm from "./pkg/flox_wasm";
const PATH = "/static/flox_wasm_bg.wasm";
const INIT = WebAssembly.compileStreaming(fetch(PATH)).then(wasm.initSync);
export const init = INIT;
export function evaluate(source: string): string {
return wasm.eval_expression(source);
}