Skip to content

Instantly share code, notes, and snippets.

@andrewbranch
Created June 30, 2015 20:09
Show Gist options
  • Save andrewbranch/93e1f342f75c36357112 to your computer and use it in GitHub Desktop.
Save andrewbranch/93e1f342f75c36357112 to your computer and use it in GitHub Desktop.
I frequently overcomplicate Promises
someAsyncMethod() {
return new Promise((resolve, reject) => {
somePromiseReturningMethod().then(x => {
resolve(doSomethingTo(x));
});
});
}
someAsyncMethod() {
return somePromiseReturningMethod().then(x => {
return doSomethingTo(x);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment