( _, _ ) ->
-- Disregard messages that arrived for the wrong page.
( model, Cmd.none )
When someone adds a new page though, it will fall into this case, which is clearly not what we want. We want the compiler to force us to add it. To achieve this, it's better to instead do:
It is more verbose but definitely more elm-like. Now if someone adds GotXMsg the compiler will tell them that they are missing a case, go elm 😃 I think it's also valuable to set an example given this repo is used as a reference for how to code in Elm by many people new to Elm.
Very easy fix to make the code more elm-like (aka the compiler more helpful).
You currently do
When someone adds a new page though, it will fall into this case, which is clearly not what we want. We want the compiler to force us to add it. To achieve this, it's better to instead do:
It is more verbose but definitely more elm-like. Now if someone adds
GotXMsg
the compiler will tell them that they are missing a case, go elm 😃 I think it's also valuable to set an example given this repo is used as a reference for how to code in Elm by many people new to Elm.