Last active
July 13, 2016 13:14
-
-
Save kg/4f48c8a81b810435534d956a50a03449 to your computer and use it in GitHub Desktop.
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
function PromiseResolver () { | |
var self = this; | |
this.promise = new Promise( | |
function (resolve, reject) { | |
self.resolve = resolve; | |
self.reject = reject; | |
} | |
); | |
}; | |
var pr = new PromiseResolver(); | |
window.setTimeout(function () { pr.resolve(1); }, 500); | |
return pr.promise; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment