Skip to content

Support Array.fromAsync in lib.esnext.d.ts #50803

@DanielRosenwasser

Description

@DanielRosenwasser

Array.fromAsync recently reached stage 3 (conditional on editor review). That means we should look into implementing it in TS under esnext.

The signature should probably be

interface ArrayConstructor {
    fromAsync<T>(iterator: AsyncIteratable<T>): Promise<T[]>;

    fromAsync<T, U>(iterator: AsyncIteratable<T>, mapFn: (value: T) => U, thisArg?: any): Promise<Awaited<T>[]>;
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions