compileWasmModule
Compiles WebAssembly bytes, once per bytes object.
The cache is keyed by the bytes object itself, so the constant an inlined .wasm import gives is compiled once however many times it is asked for, and the compiled module is released with that constant when the plugin unloads. A failed compilation is not cached.
Import:
import { compileWasmModule } from '@mnaoumov/obsidian-lib/wasm';Signature:
function compileWasmModule(bytes: ArrayBuffer | ArrayBufferView<ArrayBufferLike>): Promise<WebAssembly.Module>Parameters:
| Parameter | Type | Description |
|---|---|---|
bytes |
ArrayBuffer | ArrayBufferView<ArrayBufferLike> | The module’s bytes. |
Returns: Promise<WebAssembly.Module> — The compiled module.
Links to this page: