Last active
December 6, 2021 11:12
-
-
Save sunnyy02/4af9a0c14ef63233e1f89386d52525a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const allPromises = [fetchMockData('John', 4000), fetchMockData('Peter')]; | |
allPromises.reduce(async (p, curr) => { | |
await p; | |
return curr.then((result) => { | |
console.log('result:', result); | |
return curr; | |
}); | |
}, Promise.resolve()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment