PhoenixAssetPipeline.LiveView (phoenix_asset_pipeline v2.0.2)

Copy Markdown View Source

LiveView helpers for asset digest aware navigation.

Summary

Functions

Redirects connected LiveView clients when their asset digest is stale.

Functions

on_mount(opts, _, _, socket)

Redirects connected LiveView clients when their asset digest is stale.

Add it with:

on_mount {PhoenixAssetPipeline.LiveView, fallback_path: "/"}

The hook compares the connect param named by :digest_param (default: "_digest") with the current manifest digest. When stale, it redirects to the safe connect param named by :uri_param (default: "_uri") or to the configured :fallback_path.