Skip to main content
Module

x/ldkit/library/asynciterator.ts>ArrayIterator

LDkit - Linked Data query toolkit for TypeScript developers
Go to Latest
class ArrayIterator
extends AsyncIterator<T>
import { ArrayIterator } from "https://deno.land/x/ldkit@v0.7.0/library/asynciterator.ts";

An iterator that emits the items of a given array.

Constructors

new
ArrayIterator(items?: Iterable<T>, unnamed 1?: { autoStart?: boolean | undefined; preserve?: boolean | undefined; })

Creates a new ArrayIterator.

Properties

private
optional
_buffer
protected
_index: number
protected
_sourceStarted: boolean
protected
_truncateThreshold: number

Methods

protected
_destroy(cause: Error | undefined, callback: (error?: Error) => void): void
protected
_toStringDetails(): string
read(): T | null
toArray(options?: { limit?: number; }): Promise<T[]>

Consume all remaining items of the iterator into an array that will be returned asynchronously.