title: Conditional then in promises (bluebird)
body: <p>What I want to do</p>
  
  <pre><code>getFoo()
    .then(doA)
    .then(doB)
    .if(ifC, doC)
    .else(doElse)
  </code></pre>
  
  <p>I think the code is pretty obvious? Anyway:</p>
  
  <p>I want to do call a promise when a specific condition (also a promise) is given. I could probably do something like</p>
  
  <pre><code>getFoo()
    .then(doA)
    .then(doB)
    .then(function(){
      ifC().then(function(res){
      if(res) return doC();
      else return doElse();
    });
  </code></pre>
  
  <p>But that feels pretty verbose.</p>
  
  <p>I'm using bluebird as promise library. But I guess if there is something like that it'll be the same in any promise library.</p>