cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

when.spread() docs give an bad _equivalent_ code sample #459

Closed jurko-gospodnetic closed 9 years ago

jurko-gospodnetic commented 9 years ago

when.spread() documentation does not mention that it automatically resolves promises contained in the received array.

The behaviour is consistent between when & bluebird promise implementations, but got me in some trouble because it is not mentioned in the when documentation.

The equivalent code example given in the documentation is not actually equivalent as it does not resolve such contained promises.

briancavalier commented 9 years ago

Hey @jurko-gospodnetic, sorry for the inaccurate docs. I'll update them.

Out of curiosity, what trouble did it get you into? Were you expecting it not to deeply resolve the promises within the array?

jurko-gospodnetic commented 9 years ago

Yeah. Checked the docs and wrote code according to them. :-) Then something failed later on when someone passed a promise there. No big deal, once I figured out what was going on, but took me for a few loops before I considered that the external library docs were incorrect since the example in them was so clear. :-)

briancavalier commented 9 years ago

@jurko-gospodnetic Fixed. Check out ed92496 :)