Created
March 19, 2017 15:57
-
-
Save ecmel/3984284f1e37701e3812bef2a1a7cd92 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 Deferred(data) { | |
this.data = data || {} | |
this.promise = new Promise((resolve, reject) => { | |
this.resolve = resolve | |
this.reject = reject | |
}) | |
Object.freeze(this) | |
} | |
export default Deferred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment