title: Handle Deferrred with ASYNC AJAX calls
body: <p>I have a function that looks similar to the following:</p>
  
  <pre><code>function refreshData() {
      service.getSettings().done(function (settings) {
          // DATA 1
          service.getData1(settings).done(function (result) {
              // do something local with result
              // partial resolve 1
          });
          // DATA 2
          var localData = service.getLocalData();
          if (localData.length) {
              service.getData2(settings, localData).done(function (result) {
                  // do something local with result
                  // partial resolve 2
              });
          } else {
              $('#list').empty();
              // or partial resolve 2
          }
      });
  }
  </code></pre>
  
  <p>What I want to do is create a Deferred object for this function so I know when the data refresh is fully done. I know I could chain them together with <code>$.when</code> but I want the two AJAX calls to run independently and I don't care if one finishes before the other.</p>
  
  <p>I've marked above where I want to each piece to resolve. I'm just not sure how to accomplish this.</p>
  
  <p>My end goal would be a call like this:</p>
  
  <pre><code>refreshData().done(function() {    
      // hide loader
  });
  </code></pre>