From dbdaba4181f32a8cbf0790399a57d094f5fddde8 Mon Sep 17 00:00:00 2001 From: Tristan Davies Date: Fri, 13 Nov 2015 15:41:00 -0500 Subject: [PATCH] fix example to use map instead of forEach forEach returns undefined, so this would execute `Promise.all(undefined)` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f88e69..dfa9e7e 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Although flipping the order of function & argument may seem small, it opens sign ```js fetchPlayers() - .then(players => players.filter( p => p.score > 100 ).forEach( fetchGames )) + .then(players => players.filter( p => p.score > 100 ).map( fetchGames )) |> Promise.all |> then(processGames) |> catchError( ProcessError, err => [] )