Created
January 19, 2016 20:25
-
-
Save digitalhitler/e01c4dfc3b1f4d33e05f to your computer and use it in GitHub Desktop.
Promise-way sandboxed context module preloading and then executing code.
This file contains 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
// It is not yet another reinventing the well. | |
// Did you ever see what's happens with module that requires lots of times in | |
// a row for example in Express? | |
// Check it out and come back! | |
Promise.all(['module1', 'module2', 'module3'] | |
.map(x => System.import(x))) | |
.then(([module1, module2, module3]) => { | |
// Do something in separate scope. | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment