API Reference

Class List

WasmModule

A pure static utility class which supports immediate and lazy loading of wasm modules.

Summary

Static Methods

getInstance

Get a wasm module instance.

setConfig

Set a wasm module's configuration.

Details

Static Methods

getInstance(moduleName, callback)

Get a wasm module instance. The instance will be created if necessary and returned in the second parameter to callback.

Parameters

moduleNamestring

Name of the module.

callbackModuleInstanceCallback

The function called when the instance is available.

setConfig(moduleName, [config])

Set a wasm module's configuration.

Parameters

moduleNamestring

Name of the module.

configobject

The configuration object.

config.glueUrlstring

URL of glue script.

config.wasmUrlstring

URL of the wasm script.

config.fallbackUrlstring

URL of the fallback script to use when wasm modules aren't supported.

config.errorHandlerModuleErrorCallback

Function to be called if the module fails to download.

Constructor

WasmModule()