Skip to content

Instantly share code, notes, and snippets.

@ianldgs
Last active October 2, 2019 08:38
Show Gist options
  • Save ianldgs/914c7c67969ddb62433601fc861480aa to your computer and use it in GitHub Desktop.
Save ianldgs/914c7c67969ddb62433601fc861480aa to your computer and use it in GitHub Desktop.
const toSinglePromise = (acc, curr, o, arr) => arr = Promise.all(arr);
const toSinglePromise = (acc, curr, o, arr) => {
console.log('called', i+1, 'times')
return arr = Promise.all(arr)
};
await [Promise.resolve('a'), Promise.resolve('b')].reduce(toSinglePromise)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment