effect-io-ai

Package: effect
Module: Stream

Stream.repeatValue

Repeats the provided value infinitely.

Example

import { Effect, Stream } from "effect"

const stream = Stream.repeatValue(0)

Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
// { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }

Signature

declare const repeatValue: <A>(value: A) => Stream<A>

Source

Since v2.0.0