/utils/scriptElement

The module exports a default method to load scripts from tags.

Methods

(async, inner) scriptElement(src, typeopt) → {Promise.<Event>}

The scriptElement method adds a promise to the promises object for a script src to be loaded.

An existing promise will be awaited.

The promise resolves with the load event.

Parameters:
NameTypeAttributesDefaultDescription
srcstring

The script element src.

typestring<optional>
'module'

The script type.

Returns:

The promise resolves to the load event for the script element.

Type: 
Promise.<Event>