Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / range

Function: range()

range(start, count, step?): Stream<number>

Defined in: projects/libraries/streamix/src/lib/streams/range.ts:17

Creates a stream that emits a sequence of numbers, starting from start, incrementing by step, and emitting a total of count values.

This operator is a powerful way to generate a numerical sequence in a reactive context. It's similar to a standard for loop but produces values as a stream. It's built upon the loop operator for its underlying logic.

Parameters

start

MaybePromise<number>

The first number to emit in the sequence.

count

MaybePromise<number>

The total number of values to emit. Must be a non-negative number.

step?

MaybePromise<number> = 1

The amount to increment or decrement the value in each step.

Returns

Stream<number>

A stream that emits a sequence of numbers.

Released under the MIT License.