Skip to content

Instantly share code, notes, and snippets.

@guisouza
Created May 25, 2017 02:56
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 guisouza/583db7e8473efd339130d0649d221108 to your computer and use it in GitHub Desktop.
Save guisouza/583db7e8473efd339130d0649d221108 to your computer and use it in GitHub Desktop.
resolvendo o "callback-hell" descrito em : https://medium.com/balta-io/nodejs-async-await-21ca3636252a
function main() {
funcaoUm()
.then((um) => {
console.log(um);
return funcaoDois()
})
.then((dois) => {
console.log(dois);
return funcaoTres()
})
.then((tres) => {
console.log(tres);
return funcaoQuatro()
})
.then((quatro) => {
console.log(quatro);
return funcaoCinco()
})
.then((cinco) => {
console.log(cinco);
return funcaoSeis()
})
.then((seis) => {
console.log(seis);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment