Skip to content

Commit

Permalink
use Promise.resolve in mapSequence, to ensure each item is thenable - f…
Browse files Browse the repository at this point in the history
…ixes #1532
  • Loading branch information
Rich-Harris committed Aug 16, 2017
1 parent aaca8b5 commit 8ec3e0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/promise.js
Expand Up @@ -3,7 +3,7 @@ export function mapSequence ( array, fn ) {
let promise = Promise.resolve();

function next ( member, i ) {
return fn( member ).then( value => results[i] = value );
return Promise.resolve( fn( member ) ).then( value => results[i] = value );
}

for ( let i = 0; i < array.length; i += 1 ) {
Expand Down

0 comments on commit 8ec3e0d

Please sign in to comment.