Created
March 13, 2019 21:26
-
-
Save josephm28/16e4acdc955ba52b6abcefde07bfbf24 to your computer and use it in GitHub Desktop.
Dynamically load JS scripts in bulk. Wait for all scripts to be loaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async loadJSScripts(){ | |
return new Promise((resolve, reject)=>{ | |
const scriptsToBeLoaded = [...]; | |
await Proimise.all( | |
scriptsToBeLoaded.map(async script => await $.getScript(script)) | |
); | |
resolve(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment