title: wrapping function in deferred
body: <p>I'm trying to create a queue that I can wrap the objects passed in with deferred in order to make the objects that have a Model and Action properties (Action is just an ajax call) finish before calling the next.</p>
  
  <pre><code>        var promises = [];
  
          _.each(this.List, (model) =&gt; {   // List is just an object that has a Model and Action property
              var wrapperFunc = (() =&gt; {
                  var deferred = $.Deferred();
                  model.Action();
                  deferred.resolve();
  
                  promises.push(wrapperFunc);
              });
          });
  </code></pre>
  
  <p>The problem is, model.Action() just gets called.  Am I going about this wrong?  </p>