Generatorscyclecycle Callablecycle<T>(xs: Mappable<T>): InfiniteGenerator<T>Creates a generator cycles through the given Mappable. The generator makes the given Mappable applicative before cycling through it. This ensures the cycle is reentrant. Examplecollect(take(cycle([1, 2]), 4))// => [1, 2, 1, 2]function* foobar() { yield 'foo' yield 'bar'}collect(take(counter(foobar), 4))// => ["foo", "bar", "foo", "bar"]Type parametersTThe item type.Parametersxs: Mappable<T>The Mappable values to cycle through.Returns InfiniteGenerator<T>The cycle generator.
Creates a generator cycles through the given Mappable.
The generator makes the given Mappable applicative before cycling through it. This ensures the cycle is reentrant.
Example