@szilanor/stream
    Preparing search index...

    Function cycle

    • Returns a Stream that infinitely yields elements of the Iterable parameter.

      Type Parameters

      • T

        Type of items in the iterable.

      Parameters

      • iterable: Iterable<T>

        Iterable to cycle.

      Returns Stream<T>

      Stream that yields elements of the iterable infinitely.

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