# `AshBackendDrivenOptimisticUi.Resource.Transformers.DeriveSets`
[🔗](https://github.com/Undeadlol1/ash_backend_driven_optimistic_ui/blob/v0.1.0/lib/ash_backend_driven_optimistic_ui/resource/transformers/derive_sets.ex#L1)

Reads each optimistic action and prepends a derived `set` for every readable
change: `atomic_update(attr, expr)`, and `set_attribute(attr, v)` with a
literal or `arg(...)` value. A change module that implements
`AshBackendDrivenOptimisticUi.Change` describes its own sets. Other change
modules and changes guarded by `where` are skipped, so a rule never claims
more than the action shows. A create also gets `set attr, expr(arg(attr))` for every attribute it
accepts: the new record is built from the input. An update gets the same set
for each accepted attribute, inside `where expr(has_arg(attr))`: an update
changes a field only when the input carries it. A declared `set` for the
same attribute wins, and so does a readable change over an accepted one.
A destroy rule that declares no effect gets `remove()`.

# `after_compile?`

# `before?`

---

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