I got myself stuck in a pyramid of doom using Promises.
I have the following:
getA
getB
getC
getC
depends on getB
(and getA
) that depends on getA
.
So I must call them like this
getA(param)
.then(getB)
.then(getC)
but, as stated, I need the output of getA
as a paramater to getC
, so I did this
getA(param)
.then(function (A) {
getB(A)
.then(function (B) {
getC(A, B)
});
});
yes, the pyramid got me... I have brought shame upon my family. Help me regain my honor back.