vendredi 13 février 2015

Does Ember.RSVP.all.then take 1 or 2 parameters?

I'm creating a function that sends off a bunch of promises and I want to let the user know what happened when they have all resolved. But, I'm not sure what parameters Ember.RSVP.all.then() should take. Right now I have something like this:



Ember.RSVP.all(promises).then(
(success) ->
do stuff...
(error) ->
handle errors
)


But, I've also seen a pattern like this:



Ember.RSVP.all(promises).then(
(values) ->
do stuff...
).catch(
(values) ->
handle errors
)


Any clarification on this would be greatly appreciated. Thanks!





Aucun commentaire:

Enregistrer un commentaire