Skip to content

Instantly share code, notes, and snippets.

@pionize

pionize/.js Secret

Created April 27, 2017 08:31
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 pionize/2fd75981c58efd2752928ead2ba9b3f4 to your computer and use it in GitHub Desktop.
Save pionize/2fd75981c58efd2752928ead2ba9b3f4 to your computer and use it in GitHub Desktop.
function onGetUserAndUserAccount(user, userAccount) {
return doSomething(user, userAccount);
}
function onGetUser(user) {
return getUserAccountById(user.id).then(function (userAccount) {
return onGetUserAndUserAccount(user, userAccount);
});
}
getUserByName('andrew')
.then(onGetUser)
.then(onGetCompany)
.then(onGetJob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment