/utils/esmImport

The module exports a default method to import modules from esm.sh cdn.

Methods

(async, inner) esmImport(module) → {Promise.<(Module|Error)>}

The esmImport method add a promise to the promises object for the module to be imported.

An existing promise will be awaited.

The promise resolves to the module to be imported.

The promise resolves to an error if the module can not be imported. The failed promise is removed from the promises object so that a subsequent call can retry the import.

Parameters:
NameTypeDescription
modulestring

The module to import.

Returns:

The promise resolves to the imported module or an error if the import failed.

Type: 
Promise.<(Module|Error)>