title: Flattening promise chain with readable function name
body: <p>I saw promise implementation in <a href="https://stackoverflow.com/questions/26076511/handling-multiple-catches-in-promise-chain">Handling multiple catches in promise chain</a> which produce a very readable chain</p>
  
  <pre><code>return validateInput
                   .then(checkLoginPermission)
                   .then(checkDisableUser)
                   .then(changePassword);
  </code></pre>
  
  <p>However, in order to do this each function needs to return a value instead of a Promise? Since Promise can resolves to either value or a Promise so this is not a problem. My goal is to turn every function to have readable clear logic as such.</p>
  
  <p>The problem occurs when trying to unwind the nested promise function</p>
  
  <pre><code>return validateInput
         .then(function(resultA) {
              return checkLoginPermission
                 .then (function(resultB) {
                     // Do something with resultA
                 })
         });
  </code></pre>
  
  <p>Imagine the original implementation involves accessing the value from previous promise. With nested promise, it is easily achievable. But with flatten chain, I would need to break up each function like this</p>
  
  <pre><code>function validateInput = function (resultA ) {
          return Promise.resolve({resultA : resultA, resultB : 
  }
  function checkLoginPermission = function (mix ) {
          let resultA = mix.resultA;
          let resultB = mix.resultB
          //Do something with resultA
          ... 
  }
  </code></pre>
  
  <p>This is worse when the last function in the chain rely on something from the very beginning. That means the value have to be passed down from the beginning of the chain even if it was not used. </p>
  
  <p>So am I accidentally stepping on some kind of anti-pattern that might affect performance? How else can I achieve good readability without all these hassles?</p>