~/talk

A Better Pattern for Reusable LiveView Components

Talkat ElixirConf EU 2026 · 2026-04-23..04-24· [frontend-architecture]
slides:none on file

Pattern claims LiveComponent-like behavior while giving direct mailbox access by combining attach_hook/4 hooks with function components, keeping each widget in one module: a state struct, LiveView hooks for handle_event/handle_info/handle_params, and a pure render function. Demo shows multiple independent chat widgets on one page, PubSub subscriptions and URL-param-driven topics, and a recommended PubSub manager for reference counting to avoid duplicate messages. Also covers stream pruning pitfalls and when to keep streams decoupled from widget state.

AI-written summary · about

  1. 0:00Introduction
  2. 2:14Widget challenges
  3. 3:59LiveView hooks foundation
  4. 5:25Widget blueprint and state
  5. 7:33Live demo: corporate chat
  6. 9:43Single widget module
  7. 10:04Implementing the three hooks
  8. 14:04PubSub pitfalls and fixes
  9. 15:10Streams and memory efficiency
  10. 17:58Final recommendations
  11. 18:18Resources and closing
  12. 18:38Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.