Created
December 11, 2018 12:39
-
-
Save pmogollons/97e933d453866561bdc5d77642dbe3e0 to your computer and use it in GitHub Desktop.
This file contains 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 startCallbackHell() { | |
callback1(params, (error, response) => { | |
if (error) { | |
// Do something with the error | |
} else { | |
callback2({ response }, (error, response) => { | |
if (error) { | |
// Do something with the error | |
} else { | |
callback3({ response }, (error, response) => { | |
if (error) { | |
// Do something with the error | |
} else { | |
callback4({ response }, (error, response) => { | |
if (error) { | |
// Do something with the error | |
} else { | |
callback5({ response }, (error, response) => { | |
if (error) { | |
// Do something with the error | |
} else { | |
... | |
} | |
}); | |
} | |
}); | |
} | |
}); | |
} | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment