Created
May 3, 2017 12:35
-
-
Save ithinkihaveacat/e1f1641a8d33f098b777b9aad155a4b5 to your computer and use it in GitHub Desktop.
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
window.myLibrary = (() => { let a, p = new Promise((...args) => a = args); [p.resolve, p.reject] = a; return p; })(); | |
window.myLibrary.resolve("jjj"); // when library ready | |
window.myLibrary.then(console.log); // outputs "jjj" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment