Update CommonPatterns.md
This commit is contained in:
parent
4d8d1287d2
commit
08fb076071
@ -186,12 +186,14 @@ fade.done {
|
||||
}
|
||||
```
|
||||
|
||||
Or if you have an array of promises:
|
||||
Or if you have an array of closures that return promises:
|
||||
|
||||
```swift
|
||||
var foo = Promise()
|
||||
for nextPromise in arrayOfPromises {
|
||||
foo = foo.then { nextPromise }
|
||||
for nextPromise in arrayOfClosuresThatReturnPromises {
|
||||
foo = foo.then(nextPromise)
|
||||
// ^^ you rarely would want an array of promises instead, since then
|
||||
// they have all already started, you may as well use `when()`
|
||||
}
|
||||
foo.done {
|
||||
// finish
|
||||
|
||||
Loading…
Reference in New Issue
Block a user