Skip to content

Instantly share code, notes, and snippets.

@marekventur
Created May 20, 2016 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marekventur/4ba82a6431a5eaa51bcd5d98beffded9 to your computer and use it in GitHub Desktop.
Save marekventur/4ba82a6431a5eaa51bcd5d98beffded9 to your computer and use it in GitHub Desktop.
ES6 Deferred
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