@metreeca/pipe - v0.9.11
    Preparing search index...

    Function iterate

    • Creates a pipe by repeatedly calling a generator function until exhausted.

      The generator is called on demand and returned data is flattened into the stream. Iteration stops when the generator returns undefined, an empty array, or an empty iterator.

      The generator can be either synchronous or asynchronous (returning a Promise). Async generators are useful for pagination APIs, database cursors, or any data source where fetching the next batch requires an async operation.

      Type Parameters

      • V

        The type of items in the stream

      Parameters

      • generator: () => Data<V> | Promise<(Data<V> | undefined)> | undefined

        The function to call repeatedly to generate data, returning undefined to terminate

      Returns Pipe<V>

      A pipe yielding items from successive generator calls