# `Macaw.Live.Data`
[🔗](https://github.com/dcoai/macaw_live/blob/v0.1.0/lib/macaw/live/data.ex#L1)

How a mounted surface's slots get their data on a connected page (spec/03 §1, §2, §5,
§6, §8, §10): its readers, from `Macaw.Surface.readers/2`, subscribed to the source
managers that hold their sources (macaw_data's `Macaw.Data.Manager`), and each reader's window read
from what its manager published, handed back to the cells that read it. Adapted from
visualize's `Visualize.Board.Server.Budgets`: the readers are the core's, the budgets
clamped by the ceiling there.

- **A reader is one slot of one cell,** with the request `fetch/2` would send for it.
  The runtime names it `"<instance>/<slot>"`, so a live page asks exactly what a
  socketless one fetches (§1).
- **Each reader of a source subscribes its window to the source's manager** (§2): the
  manager of the source's name, its entry in the host's `sources:`, what its reads ask
  (`params`, `as_of`) and its viewer, none for a source that declares itself
  `viewer_independent` (`Macaw.Data.Manager.key/4`). So readers of one source, on any
  page, are one demand, one read of what their windows need, held once (§5, §6), and
  each reader finishes its own window from it.
- **A reader reads its window alone** (`Macaw.Data.Manager.Reader.read/3`), never
  calling its manager: its delivery is its window finished for its request, reduced to
  its own budget.
- **A state reader is delivered from the state,** never fetched, and an invalid reader
  is drawn `invalid` and asks nothing.
- **A cell's drawn state is computed as `fetch/2` computes it**, by
  `Macaw.Surface.drawn/2` over each slot's status and delivery, the highest winning
  (§8). The last delivery stays while a reader is `loading`, `down` or `stale`.

# `name`

```elixir
@spec name(String.t(), String.t()) :: String.t()
```

A reader's name (spec/03 §1): the cell's instance and the slot, `"<instance>/<slot>"`.

    iex> Macaw.Live.Data.name("status-table_services", "rows")
    "status-table_services/rows"

---

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