Raxol.Debug.Snapshot
(Raxol v2.3.0)
View Source
A single point-in-time capture of a TEA update cycle.
Stores the message that triggered the update, the model before and after, and a monotonic timestamp for ordering. Provides a recursive map diff utility for inspecting what changed between any two models.
Summary
Functions
Returns true if the model changed in this snapshot.
Computes the diff between two models (or two snapshots).
Creates a new snapshot.
Returns a compact summary string for a snapshot.
Types
Functions
Returns true if the model changed in this snapshot.
Computes the diff between two models (or two snapshots).
Returns a list of {:changed, path, old, new}, {:added, path, val},
and {:removed, path, val} tuples where path is a list of map keys.
iex> Snapshot.diff(%{a: 1, b: 2}, %{a: 1, b: 3, c: 4})
[{:changed, [:b], 2, 3}, {:added, [:c], 4}]
@spec new(non_neg_integer(), term(), map(), map()) :: t()
Creates a new snapshot.
Returns a compact summary string for a snapshot.