importScripts abstract method

Future<bool> importScripts(
  1. List<String> scripts
)

It's important to wait for importScripts to complete

If this returns false then it is discouraged to use the run function, because it cannot do anything other than calling its fallback parameter.

scripts cannot be empty.

example:

void main() async {
  final bool loaded = await JsIsolatedWorker().importScripts(
    ['my_module1.js', 'my_module2.js']
  );
  if(loaded) {
    print(await JsIsolatedWorker().run(
      functionName: 'myFunction1',
      arguments: 100,
    ));
  }
}

Implementation

Future<bool> importScripts(List<String> scripts);