# `ExWapp.Store.Memory`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/store/memory.ex#L1)

In-memory store adapter for testing.

Data is stored in an Agent process and is not persisted to disk.
Useful for unit tests and development scenarios where persistence
is not required.

## Examples

    # Create a memory store
    store = ExWapp.Store.Memory.new()

    # Use in tests
    ExWapp.connect(store: ExWapp.Store.Memory)

    # Pre-populate with data
    store = ExWapp.Store.Memory.new(initial_data: %{foo: "bar"})

## Testing Usage

```elixir
defmodule MyTest do
  use ExUnit.Case

  setup do
    store = ExWapp.Store.Memory.new()
    {:ok, store: store}
  end

  test "stores data", %{store: store} do
    assert :ok = ExWapp.Store.persist(store, %{key: "value"})
    assert {:ok, %{key: "value"}} = ExWapp.Store.load(store)
  end
end
```

# `t`

```elixir
@type t() :: %ExWapp.Store.Memory{
  agent: pid(),
  message_table: ExWapp.Store.MessageTable.t()
}
```

# `get`

```elixir
@spec get(t(), atom(), term()) :: term()
```

# `load_device_cache`

```elixir
@spec load_device_cache(t()) :: map()
```

# `load_signal_sessions`

```elixir
@spec load_signal_sessions(t()) :: term()
```

# `persist_device_cache`

```elixir
@spec persist_device_cache(t(), map()) :: :ok
```

# `persist_signal_sessions`

```elixir
@spec persist_signal_sessions(t(), term()) :: :ok
```

# `stop`

```elixir
@spec stop(t()) :: :ok
```

Stops the underlying Agent process.

Call this in test teardown if you want to clean up the process.

# `update`

```elixir
@spec update(t(), atom(), term()) :: :ok
```

Updates specific keys in the store without replacing all data.

This is a convenience function for tests that need to modify
specific fields.

## Examples

    store = ExWapp.Store.Memory.new()
    ExWapp.Store.Memory.update(store, :noise, %{static_private: <<...>>})

---

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