Skip to main content
Module

x/ldkit/library/asynciterator.ts>AsyncIterator#read

LDkit - Linked Data query toolkit for TypeScript developers
Go to Latest
method AsyncIterator.prototype.read
Re-export
import { AsyncIterator } from "https://deno.land/x/ldkit@v0.6.4/library/asynciterator.ts";

Tries to read the next item from the iterator. This is the main method for reading the iterator in on-demand mode, where new items are only created when needed by consumers. If no items are currently available, this methods returns null. The module:asynciterator.event:readable event will then signal when new items might be ready. To read all items from the iterator, switch to flow mode by subscribing to the module:asynciterator.event:data event. When in flow mode, do not use the read method.

Returns

T | null

The next item, or null if none is available