Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 {
- ...
- }
- });
- }
- });
- }
- });
- }
- });
- }
- });
- }
Add Comment
Please, Sign In to add comment