title: How to support API calls to use a Promise or Callbacks with Standard Promises, no defers or external Promise Library?
body: <p>I'm wondering how to support <code>Promise</code>'s and Callbacks in an API. So far I've read through a few articles to try to implement however all these articles use deferred or a third party Promise library that has Deferred's. I want to use Native ES Promises. I wanted to know how to implement something like this. Please do not reference Promisify or any third party library as I actually want to implement this. The function signature is like the following:</p>
  
  <pre><code>function (callback) {
    if (callback) {
      // wrap callback and return Promise thats thenable
    }
    // return a Promise thats thenable
  }
  </code></pre>
  
  <p>This is something I had in my head for how something should go but I'm not sure how to implement. If you have experience or know how to do this please reply as I'd like to learn.</p>