How do you implement a “raceToSuccess” helper, given a list of promises?
This is a classic example where inverting your logic makes it much clearer. Your “race” in this case is that you want your rejection behavior to in fact be success behavior. function oneSuccess(promises){ return Promise.all(promises.map(p => { // If a request fails, count that as a resolution so it will keep // waiting for other … Read more