Home Manual Reference Source

Function

Static Public Summary
public

async asyncIteratorToArray(asyncIterator: AsyncIterator<any>): Promise<any[]>

Spreads an asynchronous iterator inside a new array.

Static Public

public async asyncIteratorToArray(asyncIterator: AsyncIterator<any>): Promise<any[]> source

Spreads an asynchronous iterator inside a new array.

TODO Could be abstracted further with asyncIteratorForEach.

Params:

NameTypeAttributeDescription
asyncIterator AsyncIterator<any>

the input iterator.

Return:

Promise<any[]>

A new array filled with the elements of the input iterator.