Detect when a script has been fully loaded
Name | Type | Description | Status | Default |
---|---|---|---|---|
$script | { HTMLScriptElement } | The script element to detect the loading state | required |
Return { Promise } The promise that will be resolved when the script is fully loaded
import scriptLoaded from 'coffeekraken-sugar/js/dom/scriptLoaded'
scriptLoaded($script).then(($script) => {
// do something here
})
Author : Olivier Bossel [email protected] https://olivierbossel.com