Skip to content

Instantly share code, notes, and snippets.

@smpnjn
Created December 5, 2020 12:48
Show Gist options
  • Save smpnjn/c192a2aa89767a4194cb3ddbd0658382 to your computer and use it in GitHub Desktop.
Save smpnjn/c192a2aa89767a4194cb3ddbd0658382 to your computer and use it in GitHub Desktop.
// Two promises
const server1 = await import('https://get.useastserver.com/js/majorFile.js');
const server2 = await import('https://get.euserver.com/js/majorFile.js');
// First one that resolves will be used.
// If it rejects instead, it will be ignored.
Promise.any([server1, server2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment