fromBufferAsync static method
Asynchronously compiles WebAssembly Module from ByteBuffer source and instantiates it with imports.
See Instance.fromModule regarding importMap
and importObject
usage.
Implementation
static Future<Instance> fromBufferAsync(ByteBuffer buffer,
{Map<String, Map<String, Object>>? importMap,
Object? importObject}) =>
promiseToFuture<_WebAssemblyInstantiatedSource>(
_instantiate(buffer, _reifyImports(importMap, importObject)))
.then((_source) =>
Instance._(_source.instance, Module._(_source.module)));