I have a chain of jQuery promises, but I would like to skip one of them depending on the response of an earlier promise.
My code is something like:
getMoney()
.then(getBeer)
.then(getFireworks)
.then(getLighterfluid)
.then(getCrazy);
If the promise in my getFireworks function returns something like 'No fireworks available', then I want to skip the getLighterFluid promise, and move on to getCrazy.
How could I approach this with my current setup? Or do I need to rework this?