Skip to content

Return early #2

@fregante

Description

@fregante

The current implementation awaits every promise via p-map but that's not super useful, it's basically:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions