Created
March 25, 2016 20:50
-
-
Save vdclouis/9c67215d7f1f5e92f14d to your computer and use it in GitHub Desktop.
Promise defer
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
const defer = () => { | |
const result = {}; | |
result.promise = new Promise((resolve, reject) => { | |
result.resolve = resolve; | |
result.reject = reject; | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment