Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Tuple.fromAsync? #385

@js-choi

Description

@js-choi

This proposal’s spec defines a Tuple.from method akin to Array.from. #250 (see #369) also added support for proposal-iterator-helpers’s Iterator.from and proposal-async-iterator-helpers’s AsyncIterator.from. proposal-iterator-helpers is at Stage 3 and proposal-async-iterator-helpers is at Stage 2.

proposal-array-from-async is also at Stage 3 (conditional on editor review). Its Array.fromAsync is meant to coexist with AsyncIterator.from like how Array.from coexists with Iterator.from.

Should this proposal add a parallel Tuple.fromAsync?

let tup = #[];
for await (const v of asyncIter) {
  tup = #[ ...tup, v ];
}
let tup = await Tuple.fromAsync(asyncIter);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions