Created
December 19, 2016 06:01
-
-
Save shuntksh/a5b70394543af622eaf89f1569b1c083 to your computer and use it in GitHub Desktop.
Promise Sequential Iteration
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 urls = ['/task1', '/task2', ]; | |
let promise = Promise.resolve(); | |
tasks.forEach((task) => { | |
promise = promise.then(() => request.get(task)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment