# `Masu.Source.List`
[🔗](https://github.com/hattoriai/masu/blob/v0.7.0/lib/masu/source/list.ex#L1)

The source of a grid given its rows: `<.data_grid rows={@users}>`.

The rows are maps or structs. The list filters, searches and sorts them
in the LiveView's process when the query changes, once, and keeps the
result as a tuple, so each block the browser asks for is read without
walking the list. A search makes a text of each row at the first
search, and keeps it until the rows change.

A list is for up to about 10,000 rows, which it sorts and searches in
tens of milliseconds. Each LiveView holds its rows, and at 100,000 a
sort takes about 0.4 seconds; past 10,000, give the grid an Ecto source
and let the database do it (see the Known limits guide).

Text sorts without case, `nil` after every value, and rows that compare
equal keep their order in the list.

## A tree

With the grid's `tree` (a field of the row that holds its parent's id,
or a function of the row), the rows are a tree (`Masu.Tree`): the list
holds every row, and the grid shows the roots and the children of the
rows that are open.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
