Phoenix + Elm = 👌

The Phoenix Parts

more info: phoenixframework.org/docs/channels

Phoenix Channels

  • Like message passing, but not one to one
  • Pub-Sub model
  • Neither publishers nor subscribers have to be Erlang processes

Concepts

  • Sockets
    • Represents a single connection (Kinda like Plug.Conn)
    • Acts as a multiplexer for the routes
  • Routes
    • Defines how messages get routed to channels
  • Channels
    • Handle evens from clients
    • Three callbacks:
      • join/3, terminate/2, handle_in/3, and handle_out/3.

The Elm Parts

more info: guide.elm-lang.org

The Elm Architecture

All effects happen outside our app, performed by the Elm Runtime. We handle Message which tell us to update our state, or do create more effects

The Elm Architecture

We control what effects go out, and what data comes with with Commands and Subscriptions

<insert live coding here>

Bonus:

Elm Phoenix Presentation

By Cameron Alexander

Elm Phoenix Presentation

  • 642