Skip to main content

Class: AsyncIterableIteratorToArrayWrapper<V>

A class that wraps an async iterable iterator to add a toArray method.

Usage:

const keys: string[] = await rep.scan().keys().toArray();

Type parameters#

Name
V

Implements#

  • AsyncIterableIterator<V>

Constructors#

constructor#

new AsyncIterableIteratorToArrayWrapper<V>(it)

Type parameters#

Name
V

Parameters#

NameType
itAsyncIterableIterator<V>

Properties#

next#

Readonly next: (v?: any) => Promise<IteratorResult<V, any>>

Type declaration#

▸ (v?): Promise<IteratorResult<V, any>>

Parameters#
NameType
v?any
Returns#

Promise<IteratorResult<V, any>>

Implementation of#

AsyncIterableIterator.next


return#

Optional Readonly return: (value?: any) => Promise<IteratorResult<V, any>>

Type declaration#

▸ (value?): Promise<IteratorResult<V, any>>

Parameters#
NameType
value?any
Returns#

Promise<IteratorResult<V, any>>

Implementation of#

AsyncIterableIterator.return


throw#

Optional Readonly throw: (e?: any) => Promise<IteratorResult<V, any>>

Type declaration#

▸ (e?): Promise<IteratorResult<V, any>>

Parameters#
NameType
e?any
Returns#

Promise<IteratorResult<V, any>>

Implementation of#

AsyncIterableIterator.throw

Methods#

[asyncIterator]#

[asyncIterator](): AsyncIterableIterator<V>

Returns#

AsyncIterableIterator<V>

Implementation of#

AsyncIterableIterator.__@asyncIterator@21782


toArray#

toArray(): Promise<V[]>

Returns#

Promise<V[]>