Last active
December 11, 2018 00:50
-
-
Save rbren/328dd25af854ce1946f253fe08176ba7 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
let itemIDs = [1, 2, 3, 4, 5]; | |
itemIDs.reduce((promise, itemID) => { | |
return promise.then(_ => api.deleteItem(itemID)); | |
}, Promise.resolve()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://medium.com/datafire-io/es6-promises-patterns-and-anti-patterns-bbb21a5d0918#72e6