Comment

Comment by adamjc

>How can we make it better ? Let's start by removing the requirement for identity value to always be the promise.

I challenge the view that making the identity value being able to be something other than a Promise is 'making it better'. Pointless abstraction is one of my pet peeves in this industry. This looks like it has gone from a fairly straightforward, if kludgy, piece of code to something far more complex. Why not just:

  const listOfPromises = [...]

  const result = Promise.all(listOfPromises).then(results => {
    return results.reduce((acc, next) => acc + next)
  })


?
parent adamjc 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton