I need to stringify my id’s before sending them to the client via channel.
IIUC this involves 2 steps:
- Creating a serializer module that implements
@behaviour Phoenix.Socket.Serializer
- Configuring sockets in the endpoint to use it
Here’s step 1, the serializer module gist
Step 2:
socket "/user_socket", ChataWeb.UserSocket,
websocket: [
serializer: [{Chata.Serializer.Socket.JSON}]
],
longpoll: false
How do you get this to work?