title: How to use promises in functions that can be called in various orders?
body: <p>My goal is pretty simple. I have a bunch of async utility functions that are called in various orders.</p>
  
  <p>Right not it's like this:</p>
  
  <p><code>doSomething(doNextThing(doFinalThing));</code></p>
  
  <p>But it's becoming unwieldy. My goal is to have a syntax like this:</p>
  
  <p><code>doSomething.then(doNextThing).then(doFinalThing)</code> </p>
  
  <p>but with the ability for the order to change:</p>
  
  <p><code>doNextThing.then(doSomething).then(doFinalThing)</code></p>
  
  <p>How would I go about implementing these functions so that they are all promise-aware?</p>