# `Ramal.Merge.Result`
[🔗](https://github.com/agustinrojas1/ramal/blob/v0.2.0/lib/ramal/merge/result.ex#L1)

What `Ramal.merge/2` returns on success.

  * `branch` - the branch, now with status `:merged`
  * `records` - what the replay wrote, keyed like an overlay (`Ramal.Overlay`): `{:created, record}`,
    `{:updated, record}` or `:deleted` per `{resource, key}`, with the records as the real actions returned them
  * `replayed` - how many log entries were replayed; entries written by a hook of another action are not counted,
    because replaying that action ran the hook again
  * `stale` - the rows that had changed under the branch and that `on_stale` let through, each
    `%{resource: module, key: term, reason: :changed | :deleted}`

## Example

    %Ramal.Merge.Result{replayed: 2, stale: []} = result

# `stale_row`

```elixir
@type stale_row() :: %{resource: module(), key: term(), reason: :changed | :deleted}
```

# `t`

```elixir
@type t() :: %Ramal.Merge.Result{
  branch: Ramal.Branch.t(),
  records: Ramal.Overlay.t(),
  replayed: non_neg_integer(),
  stale: [stale_row()]
}
```

---

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