Skip to content

toArray<T>

Converts an AsyncIterableIterator to an array by consuming all its elements.

Import:

import { toArray } from 'obsidian-dev-utils/async';

Signature:

function toArray(iter: AsyncIterableIterator<T>): Promise<T[]>

Parameters:

ParameterTypeDescription
iterAsyncIterableIterator<T>The AsyncIterableIterator to convert.

Returns: Promise<T[]> — A Promise that resolves with an array of all the elements in the AsyncIterableIterator.