Collections Module
Virtualization model for large scrolling lists: `visibleRange`/`init`/`update` over `CollectionModel`.
Functions and values
| Function or value |
Description
|
Full Usage:
init controlId itemCount rowHeight viewportHeight
Parameters:
ControlId
itemCount : int
rowHeight : float
viewportHeight : float
Returns: CollectionModel * CollectionEffect list
|
Build the initial `CollectionModel` for a `controlId` and emit its first `CollectionEffect` list.
|
Full Usage:
update msg model
Parameters:
CollectionMsg
model : CollectionModel
Returns: CollectionModel * CollectionEffect list
|
Apply a `CollectionMsg` to the `CollectionModel`, returning the next model and any effects.
|
Full Usage:
visibleRange rowHeight viewportHeight scrollOffset totalItems overscan
Parameters:
float
viewportHeight : float
scrollOffset : float
totalItems : int
overscan : int
Returns: VisibleRange
|
Compute the realized `VisibleRange` from row height, viewport height, scroll offset, item total, and an `overscan` buffer (Feature 114, additive trailing parameter). `overscan = 0` reproduces the pre-feature visible slice byte-identically; a positive `overscan` shifts `FirstIndex` back by up to `overscan` and widens `Count` by up to `2 * overscan`, edge-clamped so no index is `< 0` or `>= totalItems`. Negative `overscan` is treated as 0.
|