Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / range

Function: range()

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

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

Creates an atom 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 an atom.

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

Atom<number>

An atom that emits a sequence of numbers.

Released under the GNU AGPL v3 or later.