A precomputed reactive dependency graph.
Built at compile time (via module attribute) or at runtime,
then passed to Lavash.Reactive functions to drive state updates.
The graph contains:
topo_order— derived fields in topological order for recomputationdependents— reverse index: field → list of derived fields that depend on itdeps— forward index: derived field → list of fields it depends oncompute_fns— derived field → function that computes it from depsstate_defaults— state field → default valuetags— reverse index: tag → MapSet of field names (for resource invalidation, etc.)
Summary
Functions
Returns all derived fields transitively affected by the given dirty fields.
Compiles states and derives into a frozen %Graph{}.
Returns field names that have the given tag.
Filters topo_order to only the affected fields, preserving correct evaluation order.
Functions
Returns all derived fields transitively affected by the given dirty fields.
Compiles states and derives into a frozen %Graph{}.
States: [{name, default}, ...]
Derives: [{name, [dep, ...], fun, async?} | {name, [dep, ...], fun, async?, [tag]}]
The function for each derive receives a map of dependency values:
fn %{count: 5, step: 2} -> 10 end
Returns field names that have the given tag.
Filters topo_order to only the affected fields, preserving correct evaluation order.