liveview-streams

Installation
SKILL.md

LiveView Streams

Phoenix LiveView streams (0.19+) provide efficient rendering of large collections by patching only changed DOM elements.

RULES — Follow these with no exceptions

  1. Use streams for collections with 100+ items — regular assigns re-render the entire list on every change
  2. Initialize streams in mount/3 with stream(socket, :name, collection)
  3. Use stream_insert/3 and stream_delete/3 for incremental updates — never replace the entire stream
  4. Use phx-update="stream" in templates — required for stream DOM patching
  5. Set DOM IDs with id attribute — each streamed item needs a unique DOM ID
  6. Use stream_configure/3 for custom DOM IDs — when default IDs don't match your needs
  7. Combine with pagination or infinite scroll — don't stream unlimited items
  8. Always use Repo.preload before streaming — preloading ensures data is loaded
  9. Use at: option for ordered insertion — control where new items appear in the stream

End-to-End Workflow

Installs
2
First Seen
2 days ago
liveview-streams — igmarin/elixir-phoenix-skills