This page covers Tutorial v2. Elm 0.18.
Main model
In our main application model we want to store the current route.
In src/Models.elm, change Model and initialModel to:
...
type alias Model =
{ players : WebData (List Player)
, route : Route
}
initialModel : Route -> Model
initialModel route =
{ players = RemoteData.Loading
, route = route
}
Here we:
- added
routeto the model - changed
initialModelso it takes aroute