Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active December 11, 2018 00:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbren/328dd25af854ce1946f253fe08176ba7 to your computer and use it in GitHub Desktop.
Save rbren/328dd25af854ce1946f253fe08176ba7 to your computer and use it in GitHub Desktop.
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