Elixir Nerves is awesome, but it make it awkward to test your code on your development computer - especially if it is not Linux. Here I explain how to overcome that hurdle.
Many large organisations say they want to use a Lean UX approach. In my experience, they don’t find it easy to execute in reality. Why is this? I believe we’re not helping adoption happen – we’re not following our own advice or approach, I say we can do better.
Using Ecto without Phoenix is a bit fiddly to set up. This is a step-by-step tutorial to getting through that.
In Part 11, we looked at how to fetch our initial seat data via Phoenix channels. Our application, when it loads, opens a web socket to the server and then gets the initial seat data over this connection. Now we want to take a look at how to send and receive data over that channel in response to user interaction with the site.
Since the last post we have seen updates to both Elixir and Phoenix. Furthermore, as of Phoenix version 1.1.2, the version of Brunch that is used has been upgrade to ^2.1.1. This means that we will end up upgrading Brunch to version 2.1.3 or later, which affects the elm-brunch package that we use to build our Elm project.
We took a look, in Part 9, at how to fetch our initial seat data via an HTTP request. However, one of the most compelling reasons to use Phoenix is because of it's first class support for Channels.
Upgrading to Elm 0.16.0. OK, so I know that I promised that I'd be looking at Phoenix Channels in this post, and don't worry, that post is coming soon. However a shiny new version of Elm was just released, and so we should upgrade for all of the goodness that it brings.
This part of the tutorial is actually going to be a bit of a detour. We're going to fetch the initial data for our Elm application over HTTP from a data API that we'll create in our Phoenix application.
Currently our application only allows us to model a given state and perform actions that result in changes to that state. We create an initial state for our application with the init function and thereafter are only able to change that state via the update function.
Let's take a moment to talk about what is happening behind the scenes in our Elm application.