Skip to content

Instantly share code, notes, and snippets.

@josephm28
Created March 13, 2019 21:26
Show Gist options
  • Save josephm28/16e4acdc955ba52b6abcefde07bfbf24 to your computer and use it in GitHub Desktop.
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
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