PhoenixKitWeb.Live.Modules.Entities.Hooks (phoenix_kit v1.5.1)

View Source

LiveView hooks for entity module pages.

Provides common setup and subscriptions for all entity-related LiveViews.

Summary

Functions

Subscribes to entity events and tracks user presence when the LiveView is connected.

Functions

on_mount(atom, params, session, socket)

Subscribes to entity events and tracks user presence when the LiveView is connected.

Add this to your entity LiveView with:

on_mount PhoenixKitWeb.Live.Modules.Entities.Hooks

This automatically:

  • Subscribes to entity creation, update, and deletion events
  • Tracks authenticated user presence for dashboard statistics