$.when.apply returns a promise. I though that since you are not really
overriding the default resolve and reject functions, the promise should be
sufficient to resolve as and when there is a return.

Am I missing something? What's the difference between promise and dfd?

On Thu, Jul 18, 2013 at 12:35 PM, Shrey Jairath <notifications@github.com>wrote:

> In media/coco/app/scripts/configs.js:
>
> > +                var update_dfd = new $.Deferred();
> > +
> > +                var all_update_dfds = [];
> > +                $.each(off_json.farmers_attendance, function(index, per){
> > +                    all_update_dfds.push(update_attendee(per));
> > +                });
> > +
> > +                $.when.apply($,all_update_dfds)
> > +                    .done(function(){
> > +                        update_dfd.resolve();
> > +                    })
> > +                    .fail(function(){
> > +                        update_dfd.reject();
> > +                    });
> > +                return update_dfd;
> > +            }
>
> Your function doesn't provide a way to resolve or reject update_attendees.
> How does the code calling update_attendees know that it has finished?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/digitalgreenorg/dg/pull/120/files#r5261986>
> .
>



-- 

*Nandini Bhardwaj
**Software Manager
**V*  +91.11.41881037
*M*  +91.9899850843
*E**  *nandini@digitalgreen.org
*O*  D6 & E6, Clarion Collection( The Qutab), Shaheed Jeet Singh Marg, New
Delhi-110016, India

<http://www.digitalgreen.org>
Like us on  <https://www.facebook.com/digitalgreenorg>
Follow us on  <https://twitter.com/digitalgreenorg>