From 08fb076071dcebe8650df025729241141b04d96e Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 4 Sep 2019 14:01:49 -0400 Subject: [PATCH] Update CommonPatterns.md --- Documentation/CommonPatterns.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/CommonPatterns.md b/Documentation/CommonPatterns.md index 0768cf8..e364cf0 100644 --- a/Documentation/CommonPatterns.md +++ b/Documentation/CommonPatterns.md @@ -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