Posted almost 6 years ago. Visible to the public.

Bulk promises with EmberJS

I needed not to chain promises but to resolve a whole bunch of them together. The documentation was sparse so it took me a while to stumble upon the solution (Ember.RSVP.all). In case you need something like that here it is.

promises = (resource) -> createPromise(resource) Ember.RSVP.all(promises).then((results) -> doSomethingWithIt(results))

You can create an array of promises that you pass into Ember.RSVP.all which passes an array of the results into the .then chain. Actually quite simple. :-)

Owner of this card:

Last edit:
almost 6 years ago
Posted by jan0sch to jan0sch's deck
This website uses cookies to improve usability and analyze traffic.
Accept or learn more