Return early
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The current implementation awaits every promise via p-map but that's not super useful, it's basically:
```js
const results = await Promise.all(promises);
const isEvery = results.every(myTestFunction)
```
What I'd like is an early-return like the `[].every` loop, the promise should throw/resolve as soon as the function returns false.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start from the current p-map-based implementation described in the issue and inspect how it waits for all promises before applying the predicate. Define the completion behavior for a false predicate, including outstanding promises, then verify that the returned promise settles without waiting for every input promise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100