title: delay for jquery promises
body: <p>I cannot find <code>delay</code> or <code>wait</code> function for <code>jQuery</code> promises. I have found one function on the SO (<a href="https://stackoverflow.com/q/17983331/1048572">Using jQuery.Deferred to avoid nested setTimeout callbacks</a>):</p>
  
  <pre><code>function delay(time) {
      return function () {
          console.log("Delaying");
          var ret = new $.Deferred();
          setTimeout(function () {
              ret.resolve();
          }, time);
          return ret;
      };
  }
  </code></pre>
  
  <p>And, it's the way how I use it:</p>
  
  <pre><code> run: function () {
          return $()
              .promise()
              .then(function () {
                  console.log("call together");
                  console.log("call together");    
              })
              .then(delay(2000))
              .then(function () {
                  console.log("call first");
              })
              .then(delay(2000))
              .then(function () {
                  console.log("call second");
              })
      }
  </code></pre>
  
  <p>I want to extend promise or deferred object that I can write like:</p>
  
  <pre><code>run: function () {
              return $()
                  .promise()
                  .then(function () {
                      console.log("call together");
                      console.log("call together");    
                  })
                  .delay(2000)
                  .then(function () {
                      console.log("call first");
                  })
                  .delay(2000)
                  .then(function () {
                      console.log("call second");
                  })
          }
  </code></pre>