Search documentation of phoenix_kit

# PhoenixKit.Entities.Events (phoenix_kit v1.6.19)

View Source

PubSub helpers for coordinating real-time entity updates.

Provides broadcast and subscribe helpers for:

- Entity definition lifecycle (create/update/delete)
- Entity data lifecycle (create/update/delete)
- Collaborative editing signals for entity + data forms

All events are broadcast through `PhoenixKit.PubSub.Manager` so the library remains self-contained when embedded into host applications.

# Summary

## Functions

broadcast_data_created(entity_id, data_id)
broadcast_data_deleted(entity_id, data_id)
broadcast_data_form_change(entity_id, record_key, payload, opts \\ [])
broadcast_data_form_sync_request(entity_id, record_key, requester_socket_id)
broadcast_data_form_sync_response(entity_id, record_key, requester_socket_id, state)
broadcast_data_updated(entity_id, data_id)
broadcast_entity_created(entity_id)
broadcast_entity_deleted(entity_id)
broadcast_entity_form_change(form_key, payload, opts \\ [])
broadcast_entity_form_sync_request(form_key, requester_socket_id)
broadcast_entity_form_sync_response(form_key, requester_socket_id, state)
broadcast_entity_updated(entity_id)
subscribe_to_all_data()

Subscribe to entity data lifecycle events (all entities).

subscribe_to_data_form(entity_id, record_key)

Subscribe to collaborative events for a specific data record form.

subscribe_to_data_presence(entity_id, data_id)

Subscribe to presence updates for a data record.

subscribe_to_entities()

Subscribe to entity definition lifecycle events.

subscribe_to_entity_data(entity_id)

Subscribe to data lifecycle events for a specific entity.

subscribe_to_entity_form(form_key)

Subscribe to collaborative events for a specific entity form.

subscribe_to_entity_presence(entity_id)

Subscribe to presence updates for an entity.

# Functions

# broadcast_data_created(entity_id, data_id)

# broadcast_data_deleted(entity_id, data_id)

# broadcast_data_form_change(entity_id, record_key, payload, opts \\ [])

# broadcast_data_form_sync_request(entity_id, record_key, requester_socket_id)

# broadcast_data_form_sync_response(entity_id, record_key, requester_socket_id, state)

# broadcast_data_updated(entity_id, data_id)

# broadcast_entity_created(entity_id)

# broadcast_entity_deleted(entity_id)

# broadcast_entity_form_change(form_key, payload, opts \\ [])

# broadcast_entity_form_sync_request(form_key, requester_socket_id)

# broadcast_entity_form_sync_response(form_key, requester_socket_id, state)

# broadcast_entity_updated(entity_id)

# subscribe_to_all_data()

Subscribe to entity data lifecycle events (all entities).

# subscribe_to_data_form(entity_id, record_key)

Subscribe to collaborative events for a specific data record form.

# subscribe_to_data_presence(entity_id, data_id)

Subscribe to presence updates for a data record.

# subscribe_to_entities()

Subscribe to entity definition lifecycle events.

# subscribe_to_entity_data(entity_id)

Subscribe to data lifecycle events for a specific entity.

# subscribe_to_entity_form(form_key)

Subscribe to collaborative events for a specific entity form.

# subscribe_to_entity_presence(entity_id)

Subscribe to presence updates for an entity.