mapArray
Edit this pageReactive map helper that caches each item by reference to reduce unnecessary mapping on updates. It only runs the mapping function once per value and then moves or removes it as needed. The index argument is a signal. The map function itself is not tracking.
Underlying helper for the <For>
control flow.
Arguments
Name | Type | Description |
---|---|---|
list | () => readonly T[] | The source array to map. |
mapFn | (v: T, i: () => number) => U | The mapping function. |