Guest User

Untitled

a guest
Dec 11th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function startCallbackHell() {
  2. callback1(params, (error, response) => {
  3. if (error) {
  4. // Do something with the error
  5. } else {
  6. callback2({ response }, (error, response) => {
  7. if (error) {
  8. // Do something with the error
  9. } else {
  10. callback3({ response }, (error, response) => {
  11. if (error) {
  12. // Do something with the error
  13. } else {
  14. callback4({ response }, (error, response) => {
  15. if (error) {
  16. // Do something with the error
  17. } else {
  18. callback5({ response }, (error, response) => {
  19. if (error) {
  20. // Do something with the error
  21. } else {
  22. ...
  23. }
  24. });
  25. }
  26. });
  27. }
  28. });
  29. }
  30. });
  31. }
  32. });
  33. }
Add Comment
Please, Sign In to add comment