# Function: repeat()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [forms](https://jonbogaty.com/lifecycle-kit/api/forms/readme/index.md) / repeat


# Function: repeat() {#function-repeat}


> **repeat**(`unit`, `params`): [`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)

Defined in: [forms/rules/repeat.ts:49](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/forms/rules/repeat.ts#L49)

Place `count` copies of a unit path along an axis.

The segmented-body rule: a centipede is `repeat` of one body segment with
more `count`; the difference between a caterpillar and a millipede is
`spacing` and how many legs `pair` adds at each stop, not a different rule.

Each copy is tagged `(part, i)` so the assemblage stage can put segment 0
(the head end) in front of segment 5 — draw order already reflects this
because copies are emitted low-index-first, but the tag is what lets a
consumer address "the third segment" directly rather than by array index
into an anonymous shape list.

Continuity: `spacing` and `count` are continuous parameters over ordinary
translation, so a body that is "slightly more repeated" is a body with
copies slightly further out — there is no threshold where a new segment
pops into existence except at the integer boundaries of `count` itself,
which is the one place a repeated body IS discrete in reality (an ant has
a whole number of segments).


## Parameters {#parameters}



### unit {#unit}


[`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)


### params {#params}


[`RepeatParams`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/repeatparams/index.md)


## Returns {#returns}


[`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)
