Created
May 20, 2016 11:09
-
-
Save marekventur/4ba82a6431a5eaa51bcd5d98beffded9 to your computer and use it in GitHub Desktop.
ES6 Deferred
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
function createDeferred() { | |
let resolve, reject; | |
let promise = new Promise((res, rej) => { | |
resolve = res; | |
reject = rej; | |
}); | |
return {resolve, reject, promise}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment