Created
September 12, 2019 18:08
-
-
Save sms-system/e24fa51e64c2752eb6412e03e7a0188d to your computer and use it in GitHub Desktop.
deferredPromise
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 deferredPromise () { | |
let res, rej | |
const promise = new Promise((resolve, reject) => { [res, rej] = [resolve, reject] }) | |
promise.resolve = res | |
promise.reject = rej | |
return promise | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment