PhoenixKitHelloWorld.Web.EventsLive (PhoenixKitHelloWorld v0.1.6)

Copy Markdown View Source

Activity events feed for the Hello World module.

Shows a filterable, infinite-scroll list of activity entries scoped to module: "hello_world". This is a generic pattern — every PhoenixKit module that logs activities can drop in a near-identical LiveView by changing the module filter and the path.

Pattern walkthrough

  1. Uses stream/4 with a custom dom_id: because PhoenixKit.Activity.Entry uses :uuid as the primary key (not :id).
  2. Reloads on filter change via stream(..., reset: true).
  3. Infinite scroll via an IntersectionObserver hook on a sentinel div.
  4. All PhoenixKit.Activity calls are guarded with Code.ensure_loaded?/1 so the module works even on hosts without activity logging.