@tempots/dom

ForEach() function

Renders a list of items based on a signal of arrays.

Signature:

ForEach: (value: Value, item: (value: Signal, position: ElementPosition) => TNode, separator?: (pos: ElementPosition) => TNode) => Renderable

Parameters

Parameter

Type

Description

value

Value

The signal of arrays to iterate over.

item

(value: Signal, position: ElementPosition) => TNode

The function that renders each item in the array.

separator

(pos: ElementPosition) => TNode

(Optional) The function that renders the separator between items.

Returns: Renderable

  • The renderable function that renders the list of items.