# `Macaw.Live.Assets.Store.Memory`
[🔗](https://github.com/dcoai/macaw_live/blob/v0.1.0/lib/macaw/live/assets/store/memory.ex#L1)

The default asset store (spec/06 §2.1): an ETS table its process owns, started under the
host's `Macaw.Live.Supervisor` as `<live>.Assets`, so the table is the supervisor's and
never an application's. Copied from visualize's `Visualize.Sheets` (D-297), its table
now named by the supervisor and its bound an argument.

It holds at most `limit:` entries (4,096 by default), stylesheets and proxy routes
together; past that the oldest registered is dropped, and the next mount that declares
it registers it again. Reads go to the table directly, writes through the process.
A sheet is per node with this store: a node that hasn't registered one answers `404`
for it until one of its pages renders it.

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Its child spec: `name:` (required, the table's name too) and `limit:`.

# `start_link`

```elixir
@spec start_link(keyword()) ::
  GenServer.on_start() | {:error, [Macaw.Base.Fault.t(), ...]}
```

Starts the store: `name:`, an atom, required; `limit:`, a positive integer, 4,096 unless
given. `{:ok, pid}`, or `{:error, faults}`: `{[:name], :required}`, `{[:limit], {:type,
:pos_integer}}`.

---

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