Let’s say I have a stateful component running in an admin dashboard. The component is displaying log events generated by users in realtime (with phx-update="prepend"
) - registrations, password resets, subscriptions, etc.
I want to also be able to filter log events - say, only registrations. I implement a button with “phx-click”, that via handle_event
makes an ecto query and assigns new log list into socket. The problem is of course that since parent container has phx-update="prepend"
, other log types remain displayed.
I’m thinking that having the whole stateful component rerender when applying different filters might be the solution - but I can’t figure out how to force it to rerender. Perhaps that might not be even possible?