Tailwind.Phoenix.Show (Phoenix Tailwind Notifications v0.1.3) View Source
Helper to make useful notifications to be used in LiveView show.ex files.
It implements handle_info/2 LiveView callbacks for events, updates the current assigns if the notified object matches and redirects to the given URL-function if the current item gets deleted.
The to function gets passed the socket as first and only parameter. This way you can use any assign in the socket to use the correct Route-helper.
Examples
defmodule MyWeb.MyDataLive.Show do
use MyWeb, :live_view
use Tailwind.Phoenix.Show,
notifier: MyWeb.Notifier,
key: :data,
pattern: %My.MyData{},
to: &Routes.my_data_path(&1, :index)
...
end
Link to this section Summary
Functions
When used, implements handle_info/2 for show.ex
Link to this section Functions
When used, implements handle_info/2 for show.ex