@szilanor/stream
    Preparing search index...

    Function deferAsync

    • Returns an AsyncStream that yields elements of the Iterable returned by the factory function.

      Type Parameters

      • T

        Type of items in the source.

      Parameters

      • factory: () => AsyncIterable<T>

        Factory function that returns an Iterable.

      Returns AsyncStream<T>

      AsyncStream that yields elements of the Iterable returned by the factory function.

      const result = deferAsync<number>(() => [1, 2, 3]);
      console.log(result); // [1, 2, 3]