ImFusion Web SDK

preloadWasm

ts

Fetch and compile the SDK's WebAssembly module ahead of init.

The compiled module is cached at the SDK module level. Calling preloadWasm() more than once returns the same cached promise; subsequent calls to init pick up the cached module automatically.

Parameters

ParameterTypeDescription
options?{ url?: string | URL; priority?: RequestPriority; }-
options.url?string | URLURL to fetch the wasm from. Defaults to the wasm co-located with the SDK.
options.priority?RequestPriorityFetch priority hint. Use 'low' for background preloading.

Returns

Promise<Module>

A promise that resolves to the compiled WebAssembly.Module.

Example

ts