title: Return deferred promise object and resolve it
body: <p>I have a function in form:</p>
  
  <pre><code>$.get_members = function() {
      var group_id = $('#gid').val();
      if($(this).val() == group_id)
          return;
  
      var deferr = $.Deferred();
  
      $.get(url)
          .done(function() {
              ...
              deferr.resolve();
          });
  
      return deferr.promise();
  }
  </code></pre>
  
  <p>And now the question is: how to handle situation, when <code>group_id == $(this).val()</code>? I would like to do just:</p>
  
  <pre><code>var members_deferr = $.get_members();
  
  members_deferr.done(function() {
    ...
  });
  </code></pre>
  
  <p>One idea is to check type of returned value, but its not very nice. Second idea is to resolve deferred in <code>setTimeout</code>, but I don't know if it is safe.</p>
  
  <p>Any other ideas? </p>