I have an application that relies on Phoenix Channels via PhoenixJS and a bunch of React/JS, I’m trying to port it to LiveView hoping to reduce the amount of JS code.
However, I’m getting an error when naively trying to join a channel from the LiveView, specifically a MatchError when trying to call
assign on the socket. Presumably because the LiveView socket is somehow not compatible with the Channels socket.
I googled a bit and found https://elixirschool.com/blog/live-view-with-presence/, on its “Extending the LiveView Socket” section it extends the LiveView socket but that does not seem to work either.
Any ideas as to how to best tackle this?
Thanks in advance!