A proof of concept embedding Elm in Elixir Phoenix, communicating over a channel.
Look at the JavaScript console, and inspect the web socket, to see the behind-the-scene action. The interesting bits of code are found at:
Inspired by:
- https://github.com/CultivateHQ/seat_saver/wiki
- https://github.com/justinwoo/elm-simple-ports-example/blob/master/src/elm/App.elm
- https://yobriefca.se/blog/2015/08/02/deconstructing-your-first-elm-app/
- http://www.fullyforged.com/2016/01/21/phoenix-and-elm-tracking-the-connection-status.html
To start the app:
- Install dependencies with
mix deps.get - Install more dependencies with
npm install - Finish up pulling dependencies with
cd web/elm/andelm make - Start Phoenix endpoint from project root with
mix phoenix.server
Now you can visit localhost:4000 from your browser.
(This worked when I first did it, but it doesn't right now. Seems like some dependency got updated and broke the chain. Will not investigate more right now.)