fromBytesAsync static method

Future<Instance> fromBytesAsync(
  1. Uint8List bytes, {
  2. Map<String, Map<String, Object>>? importMap,
  3. Object? importObject,
})

Asynchronously compiles WebAssembly Module from Uint8List source and instantiates it with imports.

See Instance.fromModule regarding importMap and importObject usage.

Implementation

static Future<Instance> fromBytesAsync(Uint8List bytes,
        {Map<String, Map<String, Object>>? importMap,
        Object? importObject}) =>
    promiseToFuture<_WebAssemblyInstantiatedSource>(
            _instantiate(bytes, _reifyImports(importMap, importObject)))
        .then((_source) =>
            Instance._(_source.instance, Module._(_source.module)));