readElementSetsfunction
Reads a source of element sets once: the list is frozen, a set that cannot be used is left out and counted, and a list of more than 200,000 is refused whole. It never throws: a source that fails is a failed read, and one the
signal aborted is aborted.
Import it
import { readElementSets } from "@johnmorrisdotca/chikyu-earth/door";
Definition
function readElementSets(source: ElementRecordSource, signal: AbortSignal): Promise<ElementSetsRead>
Parameters
| Name | Type | Description |
|---|---|---|
source | ElementRecordSource | The source. |
signal | AbortSignal | Aborts the read. |
Returns
Promise<ElementSetsRead>
The element sets and the count left out.
Examples
import { readElementSets, type ElementRecordSource } from "@johnmorrisdotca/chikyu-earth/door";
declare const source: ElementRecordSource;
const read = await readElementSets(source, new AbortController().signal);
console.log(read.records.length, read.skipped);