I have the usual app of post with reactions and comments.
I have succeed to make an infinite scroll with adding deleting posts and use pubsub to broadcast modification (new reaction, comments,…). So, it works well when everything is managed by the liveview.
My issue is that a post can be in a lot of different liveview. So I have a lot of duplication.
I thought using a live component was the right move but it’s not that easy as it can’t directly receive a message.
Could you clarify what you mean by this? Do you have multiple LiveViews on the same page, and each of them is displaying posts? What is the difference between the LiveViews?
I’ve created several distinct liveview to list the cards
created by a user (in the user profil)
for a topic (in the topic details show page)
in a search page
Maybe it’s ok to duplicate the code in each liveview or maybe i should create a liveview for the infinite scroll and render it inside another liveview or the on_mount/attach_hook is the right move.