Stateful diff helper that keeps numeric id assignments stable.
Summary
Functions
Compute patches for a new tree and return {patch_binary, updated_state, assigned_tree}.
Initialize diff state with an optional tree.
Types
@type t() :: %Emerge.Engine.DiffState{ event_registry: %{ required(binary()) => %{required(term()) => {pid(), term()}} }, tree: Emerge.Engine.Element.t() | nil, vdom: Emerge.Engine.VNode.t() | nil }
Functions
@spec diff_and_encode(t(), Emerge.Engine.Element.t()) :: {binary(), t(), Emerge.Engine.Element.t()}
Compute patches for a new tree and return {patch_binary, updated_state, assigned_tree}.
Initialize diff state with an optional tree.