LiveDebugger.Flash (LiveDebugger v0.1.5)

View Source

Functionalities to make flash messages work inside LiveComponents See: https://sevenseacat.net/posts/2023/flash-messages-in-phoenix-liveview-components/

Summary

Functions

Attaches hook to handle flash messages

Extended Phoenix.LiveView.put_flash/3 which works inside nested LiveViews/LiveComponents. If used in nested LiveView use root LiveView's pid.

Functions

on_mount(atom, params, session, socket)

Attaches hook to handle flash messages

push_flash(socket, message)

@spec push_flash(
  socket :: Phoenix.LiveView.Socket.t(),
  message :: String.t()
) :: Phoenix.LiveView.Socket.t()

Extended Phoenix.LiveView.put_flash/3 which works inside nested LiveViews/LiveComponents. If used in nested LiveView use root LiveView's pid.

push_flash(pid, socket, message)

@spec push_flash(
  pid :: pid(),
  socket :: Phoenix.LiveView.Socket.t(),
  message :: String.t()
) :: Phoenix.LiveView.Socket.t()