I recently created some live_components where I want to notify the users with put_flash/3
live I normally do in live_views. I know that live_components have their own flash assigns, but maybe add a way to target a process/live_view to send the put_flash
message.
Currently I use the method from this blogpost which works. It seems like a pretty standard thing to do, when making components.
Maybe there is lots of use cases I havn’t thought through.
My suggestion is something like this with an optional option:
socket |> put_flash(:info, "My message", target: live_view_pid)
I hope it makes sense