title: AngularJS $q - Return resolved directly
body: <p>I use a method that expects a promise. Sometimes however, the <code>promise</code> is resolved instantly. Currently, if the <code>promise</code> is resolved right away, I still pass the promise, and use the following:</p>
  
  <pre><code>function instantAction()
  {
      var defer = $q.defer();
  
      // Actions that are performed instantly
  
      defer.resolve();
  
      return defer.promise;
  }
  </code></pre>
  
  <p>If there a way, to just return the resolve directly, such as something along the lines of <code>return $q.resolve()</code> and skip those two extra lines?</p>