🔄 Converts a sync iterable to an async iterable.

Syntax

TypeScript
import { toAsyncIter } from '@opentf/std';

toAsyncIter<T>(iter: Iterable<T>): AsyncIterableIterator<T>

Parameters

  • iter: The sync iterable to convert.

Returns

A new async iterable iterator.

Examples

TypeScript
await toArrayIterAsync(toAsyncIter([1, 2, 3])) //=> [1, 2, 3]
Last updated on
Edit this page