Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

"q.all(promises).then" versus "q.all(promises).spread" #795

Open
Torrriate opened this issue Nov 8, 2016 · 0 comments
Open

"q.all(promises).then" versus "q.all(promises).spread" #795

Torrriate opened this issue Nov 8, 2016 · 0 comments

Comments

@Torrriate
Copy link

If later on dynamically adding promises in time (before all promises are 'finalized') to the passed 'promises'-array the 'then'-method fires unlike the 'spread'-method already after the promises that were contained within the 'promises'-array during the evaluation of that statement ("q.all(promises).then(function(){...})") are resolved wheres the 'spread'-method takes the added ones into account.
As if the 'then'-method listened to the resolution of the 'copy' of the 'promises'-array whereas the 'spread'-method listened to its 'reference'.
I wouldn't be aware of that being a feature ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant