@modelhealth/modelhealth
    Preparing search index...

    Class ItemStream<T>Internal

    An async-iterable view over a StreamSource.

    Type Parameters

    • T

    Implements

    • AsyncIterable<T>
    Index
    • get total(): Promise<number>

      The full count of items matching the filter.

      Remembered once read, so it still answers after the sequence has been read to the end, drained by all() or closed. Rejects only if the sequence was closed before anything was read from it, since there is then no count to report and no way to go and find one.

      Returns Promise<number>

    • Returns AsyncIterator<T>

    • Returns every remaining matching item, continuing from where reading stopped.

      After the sequence has been closed this returns what was already in hand rather than reading further — closing says the rest is not wanted.

      Returns Promise<T[]>

    • Releases what this stream reads from. Idempotent.

      Reading to the end releases it. Stopping early deliberately does not, so all() still returns what is left afterwards — which is why an early exit is worth closing by hand.

      Returns void