9

Realizing that nested promises is a worse form of callback hell in JavaScript.

Comments
  • 2
    Isn't it the reason they introduced async operations though?
  • 2
    No matter what tools you have you can always make a mess :P

    Promises and async makes it possible to wrote more readable code but it still requires some discipline.

    If overused anything can lead to spaghetti code.
  • 0
    Don't forget to return your promises or use await instead.
  • 1
    Why on earth would you nest promise?

    I never ever encountered a promise of a promise. You're missing something
  • 1
    No offense but I think you're not doing Promises right. The point is to chain the promises using then(). Nested Promises would be an antipattern. Or use Promise.all() if you're needing multiple async operations
  • 2
    @PeterDCarter ... to then do
    promise.then(
    rxjs.subscribe(
    rxjs.subscribe(
    promise.then(
    ...
    )
    )
    )
    )
    right?
  • 0
    I wish we had a syntax to unwind chains and nesting like this.

    Maybe using an arrow '->' or '=>'
    Or someshit.
Add Comment