PhoenixKitPhotos.LiveUpdates (PhoenixKit Photos v0.3.0)

Copy Markdown View Source

Forwards storage lifecycle messages from the host LiveView to its timelines.

Add on_mount {PhoenixKitPhotos.LiveUpdates, "timeline-component-id"} to each host LiveView, or pass a list of component IDs for multiple timelines. Components cannot receive PubSub messages themselves. This hook consumes storage lifecycle messages. Hosts with their own handlers can instead forward send_update(PhotoTimeline, id: id, refresh: true, file_uuids: ids) themselves (file_uuids is optional: with it, a timeline whose library the files are not in does nothing; without it, it refreshes).

Summary

Functions

on_mount(ids, params, session, socket)