Remix.run Logo
ch4s3 3 hours ago

> Elixir gives you too much freedom on how to write something on a syntax level

This is true perhaps compared to python or go, but not compared to Java, JS/TS, or some others.

> socket "/ws/:user_id", MyApp.UserSocket, websocket: [path: "/project/:project_id"]

Socket is a behavior, which is like a trait or interface. MyAppWeb.UserSocket implements the behavior. It's basically a convenience over having to write a bunch of repetitive WS or long poll handling every time you want a socket like thing. Its pretty well documented https://phoenix.hexdocs.pm/Phoenix.Socket.html.