Skip to main content

Function: repeat()

repeat<Value>(value): Iterable<Value, any, any>

Returns an infinite iterable that repeatedly yields value.

Type Parameters

Value

Parameters

value

Value

Returns

Iterable<Value, any, any>

Example

import { join, pipe, repeat, take } from 'lfi'

console.log(
pipe(
repeat(`sloth`),
take(4),
join(`, `),
),
)
//=> sloth, sloth, sloth, sloth
Playground

Since

v0.0.1

Defined in

generators.d.ts:289