AshDispatch.Resource.Dsl.EntityChanges (AshDispatch v0.5.1)

View Source

Data structure for entity_changes configuration in the dispatch section.

When entity_changes true is set, the resource's CRUD events are broadcast as entity_change and entity_created channel events, enabling real-time UI updates (entity snapshots, toast notifications, etc.).

Fields

  • :enabled - Whether entity change broadcasting is enabled
  • :trigger_on - Optional list of actions to restrict broadcasting to. Defaults to all create/update/destroy actions.
  • :label_fields - Fields to use for entity label. Defaults to [:title, :name].
  • :status_field - Field for entity status. Auto-detected from AshStateMachine if present.

Summary

Types

t()

@type t() :: %AshDispatch.Resource.Dsl.EntityChanges{
  __spark_metadata__: term(),
  enabled: boolean(),
  label_fields: [atom()],
  status_field: atom() | nil,
  trigger_on: [atom()] | nil
}